]> Cypherpunks repositories - gostls13.git/commit
math/big: always round after the sign is set
authorRobert Griesemer <gri@golang.org>
Sat, 14 Feb 2015 05:47:10 +0000 (21:47 -0800)
committerRobert Griesemer <gri@golang.org>
Sun, 15 Feb 2015 05:14:05 +0000 (05:14 +0000)
commit2dd7a6d41f2d28d7eb2209e8887ca80c461b52cb
tree3d9c6f5c1fb76fb945e13ff12f02d6f1590534fa
parent7aa68756c5518e0fc2e2f65cab6b933c1c48534a
math/big: always round after the sign is set

Some rounding modes are affected by the sign of the value to
be rounded. Make sure the sign is set before round is called.
Added tests (that failed before the fix).

Change-Id: Idd09b8fcbab89894fede0b9bc922cda5ddc87930
Reviewed-on: https://go-review.googlesource.com/4876
Reviewed-by: Rob Pike <r@golang.org>
src/math/big/float.go
src/math/big/float_test.go