VM: double.parse creates NaN value not identical to double.NAN. #15293
Labels
area-vm
Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends.
closed-as-intended
Closed as the reported issue is expected behavior
Example code:
main() {
print(identical(double.NAN, double.parse("NAN")));
}
prints "false", should print "true".
I'm adding a hack to prevent this problem, in double_patch.dart,
adding the line:
if (result.isNaN) return NAN;
That's a workaround, but the underlying identical operation should not make this necessary, and it suggests that it may happen in other places too.
See: https://codereview.chromium.org/85633003/diff/50001/runtime/lib/double_patch.dart
The text was updated successfully, but these errors were encountered: