]> Cypherpunks repositories - gostls13.git/commit
math/big: Always print exponent sign when using 'p' exponent for Floats.
authorRobert Griesemer <gri@golang.org>
Fri, 22 May 2015 20:58:03 +0000 (13:58 -0700)
committerRobert Griesemer <gri@golang.org>
Fri, 22 May 2015 23:12:51 +0000 (23:12 +0000)
commit2df1ccdbc6aac9e570e985437d741d723cb3497c
treed502df4099b123bcfbdfef51a11d4fe774dae984
parent22e4b8167f14bdd33738cfdc21c3396b2341f8fd
math/big: Always print exponent sign when using 'p' exponent for Floats.

Float.Format supports the 'b' and 'p' format, both of which print
a binary ('p') exponent. The 'b' format always printed a sign ('+'
or '-') for the exponent; the 'p' format only printed a negative
sign for the exponent. This change makes the two consistent. It
also makes the 'p' format easier to read if the exponent is >= 0.

Also:
- Comments added elsewhere.

Change-Id: Ifd2e01bdafb3043345972ca22a90248d055bd29b
Reviewed-on: https://go-review.googlesource.com/10359
Reviewed-by: Alan Donovan <adonovan@google.com>
src/math/big/bits_test.go
src/math/big/float.go
src/math/big/float_test.go
src/math/big/floatconv.go
src/math/big/floatconv_test.go
src/math/big/floatexample_test.go