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

specify behavior of ToStringAs* on non-doubles. #1327

Closed
floitschG opened this issue Jan 24, 2012 · 4 comments
Closed

specify behavior of ToStringAs* on non-doubles. #1327

floitschG opened this issue Jan 24, 2012 · 4 comments
Assignees
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.

Comments

@floitschG
Copy link
Contributor

toStringAsFixed, toStringAsExponential and toStringAsPrecision are defined on the num-interface. When invoked on integers should/can they convert to double first, or do they need to be implemented on integer?

@ghost
Copy link

ghost commented Feb 22, 2012

I believe the right solution would be to move toStringAsFixed, toStringAsExponential and toStringAsPrecision from num to double interface, but that is not possible while int/double duality is not solved in the Javascript Dart compilers.
Consequently, I believe we should translate anu num to double before invoking toStringAsFixed, toStringAsExponential and toStringAsPrecision.

@lrhn
Copy link
Member

lrhn commented Jun 4, 2013

We currently convert to double. That seems useful, since we don't give a way to parse the result back to an integer.

We could allow toStringAsExponential to work on integers that cannot be represented as doubles, but for now I think we should leave it as-is. I'll document this.


Set owner to @lrhn.
Added Accepted label.

@floitschG
Copy link
Contributor Author

Correct.
As of the latest discussions we tend to favor 'toDouble()' inside toStringAs* even though that means that bignums will potentially converted to "Infinity".

@lrhn
Copy link
Member

lrhn commented Aug 19, 2013

Documented as converting to double.


Added Fixed label.

@floitschG floitschG added Type-Defect area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. labels Aug 19, 2013
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
Projects
None yet
Development

No branches or pull requests

2 participants