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: Float.Format and Float.Scan conflict with the fmt Formatter and Scanner interfaces #10938

Closed
griesemer opened this issue May 22, 2015 · 5 comments
Milestone

Comments

@griesemer
Copy link
Contributor

Need to find better names so that we can smoothly interoperate with the fmt package.

Suggestion (iant):

(_Float).Format becomes (_Float).Text.

(this makes it a bit different from the conventions in strconv, but it's the best suggestion seen so far).

Also need a suggestion for (*Float).Scan.

@griesemer griesemer self-assigned this May 22, 2015
@griesemer griesemer added this to the Go1.5 milestone May 22, 2015
@nightlyone
Copy link
Contributor

Maybe (*Float).Parse instead of (*Float).Scan?

@griesemer
Copy link
Contributor Author

@nightlyone There's already a (*Float).Parse. But yes, perhaps we don't need the Scan in the current form.

@mdempsky mdempsky changed the title cmd/big: Float.Format and Float.Scan conflict with the fmt Formatter and Scanner interfaces math/big: Float.Format and Float.Scan conflict with the fmt Formatter and Scanner interfaces May 28, 2015
@gopherbot
Copy link

CL https://golang.org/cl/10493 mentions this issue.

@gopherbot
Copy link

CL https://golang.org/cl/10498 mentions this issue.

griesemer added a commit that referenced this issue May 29, 2015
This paves the way for a fmt-compatible (*Float).Format method.
A better name then Text is still desirable (suggestions welcome).

This is partly fixing issue #10938.

Change-Id: I59c20a8cee11f5dba059fe0f38b414fe75f2ab13
Reviewed-on: https://go-review.googlesource.com/10493
Reviewed-by: Alan Donovan <adonovan@google.com>
griesemer added a commit that referenced this issue May 29, 2015
- (*Float).Scan conflicted with fmt.Scanner.Scan; it was also only used
  internally. Removed it, as well as the companion ScanFloat function.

- (*Float).Parse (and thus ParseFloat) can now also parse infinities.
  As a result, more code could be simplified.

- Fixed a bug in rounding (round may implicitly be called for infinite
  values). Found via existing test cases, after simplifying some code.

- Added more test cases.

Fixes issue #10938.

Change-Id: I1df97821654f034965ba8b82b272e52e6dc427f1
Reviewed-on: https://go-review.googlesource.com/10498
Reviewed-by: Alan Donovan <adonovan@google.com>
@griesemer
Copy link
Contributor Author

This was fixed with https://go-review.googlesource.com/#/c/10498/ .

@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants