New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

math/big: Rat.SetString accepts fractions and float strings, but not hexadecimal floats #29799

Open
griesemer opened this Issue Jan 17, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@griesemer
Copy link
Contributor

griesemer commented Jan 17, 2019

See https://play.golang.org/p/cAMvG8O0V5J .

This looks like a simple oversight. It appears that at least for hexadecimal floats, the change is as simple as not requesting base=10 in the implementation of Rat.String. We might also want to accept general integer values.

At the very least, this should be documented if we don't change it.

@griesemer griesemer added the NeedsFix label Jan 17, 2019

@griesemer griesemer added this to the Go1.13 milestone Jan 17, 2019

@griesemer griesemer self-assigned this Jan 17, 2019

@griesemer

This comment has been minimized.

Copy link
Contributor Author

griesemer commented Jan 17, 2019

cc: @stamblerre Just FYI.

gopherbot pushed a commit that referenced this issue Jan 17, 2019

math/big: document that Rat.SetString accepts _decimal_ float represe…
…ntations

Updates #29799.

Change-Id: I267c2c3ba3964e96903954affc248d0c52c4916c
Reviewed-on: https://go-review.googlesource.com/c/158397
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@gopherbot

This comment has been minimized.

Copy link

gopherbot commented Jan 17, 2019

Change https://golang.org/cl/158397 mentions this issue: math/big: document that Rat.SetString accepts _decimal_ float representations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment