]> Cypherpunks repositories - gostls13.git/commit
math/big: correctly handle large exponent in SetString
authorAlberto Donizetti <alb.donizetti@gmail.com>
Fri, 21 Aug 2015 17:17:18 +0000 (19:17 +0200)
committerRobert Griesemer <gri@golang.org>
Fri, 21 Aug 2015 18:11:22 +0000 (18:11 +0000)
commit13b5dc885b8dfd550b5f8cac0e9c0a9463f30fd7
treeb46da882e26bc8f1836b8630bba8172f25d7eca0
parent92eb34b59abe75318c091175f80daba165cf7a52
math/big: correctly handle large exponent in SetString

Even though the umul/uquo functions expect two valid, finite big.Floats
arguments, SetString was calling them with possibly Inf values, which
resulted in bogus return values.

Replace umul and udiv calls with Mul and Quo calls to fix this. Also,
fix two wrong tests.

See relevant issue on issue tracker for a detailed explanation.

Fixes #11341

Change-Id: Ie35222763a57a2d712a5f5f7baec75cab8189a53
Reviewed-on: https://go-review.googlesource.com/13778
Reviewed-by: Robert Griesemer <gri@golang.org>
src/math/big/floatconv.go
src/math/big/floatconv_test.go