Issue 11551 in dart: dart2js: identical(NaN, NaN) should be true.

7 views
Skip to first unread message

da...@googlecode.com

unread,
Jun 27, 2013, 6:57:34 AM6/27/13
to bu...@dartlang.org
Status: Triaged
Owner: ----
CC: ngeo...@google.com
Labels: Type-Defect Priority-Unassigned Area-Dart2JS

New issue 11551 by l...@google.com: dart2js: identical(NaN, NaN) should be
true.
http://code.google.com/p/dart/issues/detail?id=11551

The spec now says explicitly that identical(c1, c2) is true if both c1 and
c2 are doubles representing NaN.
Dart2js generates code that makes
var n = double.NAN;
print(identical(n, n));
print false. The code seems to be:
function() {
$.print(0 / 0 === 0 / 0);
}


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

da...@googlecode.com

unread,
Jun 27, 2013, 7:01:25 AM6/27/13
to bu...@dartlang.org
Updates:
Labels: -Priority-Unassigned Priority-Medium Milestone-M6

Comment #1 on issue 11551 by kas...@google.com: dart2js: identical(NaN,
(No comment was entered for this change.)

da...@googlecode.com

unread,
Sep 25, 2013, 5:24:43 AM9/25/13
to bu...@dartlang.org

Comment #3 on issue 11551 by l...@google.com: dart2js: identical(NaN, NaN)
Identical also fails for -0/0:
main() { print(identical(-0.0, 0.0)); } // prints true

da...@googlecode.com

unread,
Jun 17, 2014, 10:39:44 PM6/17/14
to bu...@dartlang.org

Comment #6 on issue 11551 by srawl...@google.com: dart2js: identical(NaN,
Maybe this can be merged into Issue 15317. That issue is certainly newer,
but I think there is a clear path forward there.

da...@googlecode.com

unread,
Jun 18, 2014, 3:46:43 AM6/18/14
to bu...@dartlang.org

Comment #7 on issue 11551 by l...@google.com: dart2js: identical(NaN, NaN)
I think this is independent of Issue 15317, which is a request for changing
the spec for NaN identity. Whether the spec changes or not, dart2js is
implementing neither the current or the proposed spec, and doesn't
implement the spec on identical(0.0,-0.0).

da...@googlecode.com

unread,
Sep 25, 2014, 11:22:36 AM9/25/14
to bu...@dartlang.org

Comment #10 on issue 11551 by eer...@google.com: dart2js: identical(NaN,
NaN) should be true.
https://code.google.com/p/dart/issues/detail?id=11551

The fact that identical(_,_) returns false on a pair of NaNs also makes
this co19 test fail, in three distinct locations:

Language/12_Expressions/00_Object_Identity/1_Object_Identity_A02_t02.

da...@googlecode.com

unread,
Sep 25, 2014, 11:32:25 AM9/25/14
to bu...@dartlang.org

Comment #11 on issue 11551 by eer...@google.com: dart2js: identical(NaN,
NaN) should be true.
https://code.google.com/p/dart/issues/detail?id=11551

The fact that identical(_,_) returns false on a pair of NaNs also makes
this co19 test fail, in the last line:

Language/12_Expressions/00_Object_Identity/1_Object_Identity_A06_t01.

da...@googlecode.com

unread,
Jun 2, 2015, 5:04:56 PM6/2/15
to bu...@dartlang.org

Comment #12 on issue 11551 by srd...@google.com: dart2js: identical(NaN,
The spec says:
identical(c1, c2): Both c1 and c2 represent a NaN value with the same
underlying bit
pattern.

identical(double.NAN, -double.NAN) should return false therefore,
Reply all
Reply to author
Forward
0 new messages