]> Cypherpunks repositories - gostls13.git/commit
math/big: use correct precision in Float.Float32/64 for denormals
authorRobert Griesemer <gri@golang.org>
Fri, 4 Mar 2016 01:39:55 +0000 (17:39 -0800)
committerRobert Griesemer <gri@golang.org>
Fri, 4 Mar 2016 17:39:50 +0000 (17:39 +0000)
commit3858efcc586914634c5a64b8ef289abe7d4d28b3
treec6405b3419dba351a82b58124975be7f22805273
parent08c2cd84699e0aa0e9dbcfbd5f4ca89df40484f5
math/big: use correct precision in Float.Float32/64 for denormals

When a big.Float is converted to a denormal float32/64, the rounding
precision depends on the size of the denormal. Rounding may round up
and thus change the size (exponent) of the denormal. Recompute the
correct precision again for correct placement of the mantissa.

Fixes #14553.

Change-Id: Iedab5810a2d2a405cc5da28c6de7be34cb035b86
Reviewed-on: https://go-review.googlesource.com/20198
Reviewed-by: Alan Donovan <adonovan@google.com>
src/math/big/float.go
src/math/big/float_test.go