]> Cypherpunks repositories - gostls13.git/commit
math/big: fix latent decimal conversion bug
authorRobert Griesemer <gri@golang.org>
Wed, 27 May 2015 21:43:30 +0000 (14:43 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 28 May 2015 16:02:32 +0000 (16:02 +0000)
commit0c02b33acda207964adde58b610b6f2c82ffde1d
tree2d706c5eec6a6251b47f14bb5d26cfa05bc89a5f
parent5ee552815ceaa5874b73125df07265bee34d1cc1
math/big: fix latent decimal conversion bug

A decimal represented 0.0 with a 0-length mantissa and undefined
exponent, but the formatting code assumes a valid zero exponent
if the float value is 0.0. The code worked because we allocate a
new decimal value each time and because there's no rounding that
lead to 0.0.

Change-Id: Ifd771d7709de83b87fdbf141786286b4c3e13d4f
Reviewed-on: https://go-review.googlesource.com/10448
Reviewed-by: Alan Donovan <adonovan@google.com>
src/math/big/decimal.go
src/math/big/floatconv_test.go
src/math/big/ftoa.go