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

Dart VM and Frog disagree about value of large integer #1534

Closed
sethladd opened this issue Feb 4, 2012 · 3 comments
Closed

Dart VM and Frog disagree about value of large integer #1534

sethladd opened this issue Feb 4, 2012 · 3 comments
Labels
closed-duplicate Closed in favor of an existing report

Comments

@sethladd
Copy link
Contributor

sethladd commented Feb 4, 2012

Dart allows for arbitrary precision integers, while JavaScript has a max. Code that works in the VM will not work in JavaScript. This will be a surprise to many developers.

Example:

var bigInt = 346538465234590347592847298346243459756895347698465298346583746592374652378462347569234765834765947569827346583465243765923847659234765928347659567398475647495873984572947593470294387093493456870849216348723763945678236420938467345762304958724596873045876234572037862934765294365243652548673456705673465273465246734506873456729457623845623456234650457693475603768922346728346256;
  print(bigInt); // correct in Dart VM, Infinity in JavaScript

The code from Frog:

var bigInt = (346538465234590347592847298346243459756895347698465298346583746592374652378462347569234765834765947569827346583465243765923847659234765928347659567398475647495873984572947593470294387093493456870849216348723763945678236420938467345762304958724596873045876234572037862934765294365243652548673456705673465273465246734506873456729457623845623456234650457693475603768922346728346256);
  print(bigInt);

How do we handle differences like this, and communicate it to the developer?

@DartBot
Copy link

DartBot commented Feb 4, 2012

This comment was originally written by jat@google.com


See also issue #634 and mailing list discussions from last year.

@DartBot
Copy link

DartBot commented Feb 4, 2012

This comment was originally written by jat@google.com


Sorry, issue #638

@dgrove
Copy link
Contributor

dgrove commented Feb 5, 2012

Added Area-Frog, Duplicate labels.
Marked as being merged into #638.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-duplicate Closed in favor of an existing report
Projects
None yet
Development

No branches or pull requests

3 participants