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

Incorrect type-test of Infinity and NaN #562

Closed
DartBot opened this issue Nov 22, 2011 · 5 comments
Closed

Incorrect type-test of Infinity and NaN #562

DartBot opened this issue Nov 22, 2011 · 5 comments

Comments

@DartBot
Copy link

DartBot commented Nov 22, 2011

This issue was originally filed by olov.l...@gmail.com


~/projects/dart % cat nan_inf_type.dart
main() {
  var inf = double.INFINITY;
  var nan = double.NAN;
  print("$inf is int: ${inf is int}, is double: ${inf is double}, is num: ${inf is num}");
  print("$nan is int: ${nan is int}, is double: ${nan is double}, is num: ${nan is num}");
}

~/projects/dart % dart nan_inf_type.dart
Infinity is int: false, is double: true, is num: true
NaN is int: false, is double: true, is num: true

~/projects/dart % dart/frog/frogsh nan_inf_type.dart
Infinity is int: true, is double: true, is num: true
NaN is int: true, is double: true, is num: true

Frog and dartc should match the vm, i.e. Infinity and NaN is! int.

@DartBot
Copy link
Author

DartBot commented Nov 24, 2011

This comment was originally written by drfibonacci@google.com


Added Area-Compiler, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Mar 28, 2012

This comment was originally written by zundel@google.com


These are runtime decisions made by trying to determine the dart type of a JS Number. Shouldn't affect dartc static analysis since code generation is removed. Unassigning from dartc as the other JS compilers likely have the same issue.


Removed Area-Compiler label.
Added New label.

@anders-sandholm
Copy link
Contributor

Added Area-Dart2JS, Triaged labels.

@kasperl
Copy link

kasperl commented Mar 28, 2012

Changed the title to: "Incorrect type-test of Infinity and NaN".

@kasperl
Copy link

kasperl commented Sep 3, 2012

We do not treat infinity and NaN as ints in dart2js.


Added Fixed label.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants