Skip to content
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

Closed
griesemer opened this issue Jan 17, 2019 · 3 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@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 The path to resolution is known, but the work has not been done. 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
Copy link
Contributor Author

cc: @stamblerre Just FYI.

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

Updates #29799.

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

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

@gopherbot
Copy link

Change https://golang.org/cl/168237 mentions this issue: math/big: accept non-decimal floats with Rat.SetString

@golang golang locked and limited conversation to collaborators Mar 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

2 participants