aboutsummaryrefslogtreecommitdiff
path: root/src/math/big/floatconv.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2015-02-13 12:47:44 -0800
committerRobert Griesemer <gri@golang.org>2015-02-14 00:42:05 +0000
commit31e852402fdf36ccc9fd84436d082e960b755cd3 (patch)
tree3c31bbead00b5405ccf58c6cc01f5b9003e77348 /src/math/big/floatconv.go
parent7a77d8d1e9b006ae49fd456a8912a8ec03af8ec7 (diff)
downloadgo-31e852402fdf36ccc9fd84436d082e960b755cd3.tar.xz
math/big: fix aliasing error in Add, Sub
Also: - make representation more flexible (no need to store trailing 0 digits to match precision) - simplify rounding as a consequence - minor related fixes TBR adonovan Change-Id: Ie91075990688b506d28371ec3b633b8267397ebb Reviewed-on: https://go-review.googlesource.com/4841 Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'src/math/big/floatconv.go')
-rw-r--r--src/math/big/floatconv.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/math/big/floatconv.go b/src/math/big/floatconv.go
index 71920cd51c..511cc51889 100644
--- a/src/math/big/floatconv.go
+++ b/src/math/big/floatconv.go
@@ -215,9 +215,9 @@ func (x *Float) Append(buf []byte, format byte, prec int) []byte {
return x.bigFtoa(buf, format, prec)
}
-// BUG(gri): Currently, String uses the 'p' (rather than 'g') format.
+// BUG(gri): Currently, String uses x.Format('g', 10) rather than x.Format('g', -1).
func (x *Float) String() string {
- return x.Format('p', 0)
+ return x.Format('g', 10)
}
// bstring appends the string of x in the format ["-"] mantissa "p" exponent