]> Cypherpunks repositories - gostls13.git/commit
math/big: fix rounding to smallest denormal for Float.Float32/64
authorRobert Griesemer <gri@golang.org>
Fri, 18 Mar 2016 18:16:35 +0000 (11:16 -0700)
committerRobert Griesemer <gri@golang.org>
Mon, 21 Mar 2016 20:24:06 +0000 (20:24 +0000)
commita14537816eb960ae24ce13364390ded124f5ebc8
treeed439185b0dbaf74dccc6e834ef2697c8fb2f15a
parent478b594d5117729694deecbcb205bb15b6085f7a
math/big: fix rounding to smallest denormal for Float.Float32/64

Converting a big.Float value x to a float32/64 value did not correctly
round x up to the smallest denormal float32/64 if x was smaller than the
smallest denormal float32/64, but larger than 0.5 of a smallest denormal
float32/64.

Handle this case explicitly and simplify some code in the turn.

For #14651.

Change-Id: I025e24bf8f0e671581a7de0abf7c1cd7e6403a6c
Reviewed-on: https://go-review.googlesource.com/20816
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
src/math/big/float.go
src/math/big/float_test.go