]> Cypherpunks.ru repositories - gostls13.git/commit
math/big: accept non-decimal floats with Rat.SetString
authorRobert Griesemer <gri@golang.org>
Mon, 18 Mar 2019 23:10:07 +0000 (16:10 -0700)
committerRobert Griesemer <gri@golang.org>
Mon, 25 Mar 2019 22:29:26 +0000 (22:29 +0000)
commite4ba40030f9ba4b61bb28dbf78bb41a7b14e6788
tree583c2cfc55917fad02865f2627169a277da68465
parenta591fd08dd30de0e22e759df0fcff961fb3d32d8
math/big: accept non-decimal floats with Rat.SetString

This fixes an old oversight. Rat.SetString already permitted
fractions a/b where both a and b could independently specify
a base prefix. With this CL, it now also accepts non-decimal
floating-point numbers.

Fixes #29799.

Change-Id: I9cc65666a5cebb00f0202da2e4fc5654a02e3234
Reviewed-on: https://go-review.googlesource.com/c/go/+/168237
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
src/math/big/floatconv.go
src/math/big/nat.go
src/math/big/ratconv.go
src/math/big/ratconv_test.go