]> Cypherpunks repositories - gostls13.git/commit
math/big: add %x float format
authorRuss Cox <rsc@golang.org>
Wed, 30 Jan 2019 05:49:33 +0000 (00:49 -0500)
committerRuss Cox <rsc@golang.org>
Tue, 26 Feb 2019 19:39:11 +0000 (19:39 +0000)
commit675503c507194a48c01a39a0f25a6d0c9d772477
tree7cc66323a921e082cbb50f47be84b9ae49d62314
parent1e58bb14910f117554e5e749648e8b0d0771726b
math/big: add %x float format

big.Float already had %p for printing hex format,
but that format normalizes differently from fmt's %x
and ignores precision entirely.

This CL adds %x to big.Float, matching fmt's behavior:
the verb is spelled 'x' not 'p', the mantissa is normalized
to [1, 2), and precision is respected.

See golang.org/design/19308-number-literals for background.

For #29008.

Change-Id: I9c1b9612107094856797e5b0b584c556c1914895
Reviewed-on: https://go-review.googlesource.com/c/160249
Reviewed-by: Robert Griesemer <gri@golang.org>
src/math/big/floatconv_test.go
src/math/big/ftoa.go