3 ms·
Numbers between DartVM run code and JS compiled code have different behavior[0]. [0] https://code.google.com/p/dart/issues/detail?id=1533 https://code.google.c
by kyrra 12y ago
Numbers between DartVM run code and JS compiled code have different behavior[0].
[0] https://code.google.com/p/dart/issues/detail?id=1533 https://code.google.com/p/dart/issues/detail?id=1533
- mythz 12y agoEveryone likes to bring up this same issue each time which is rarely an issue in practice. Yes, numeric overflows have different behavior because of Dart's variable integers vs JS where all numbers are floats behind the scenes. There is a VM and command-line `throw_on_javascript_int_overflow` flag that can be used to throw an error if there is any such overflow in your app. Ideally when BigNums lands in JS this will no longer be an issue.
- JohnHaugeland 12y agoIt's breathtaking when someone asks for examples, then discards the answer they get as too common.
- mythz 12y agoThings that rarely happen in practice aren't mine-fields. The only common thing in this issue is that it's brought up in every Dart thread, the actual issue of integer overflows is itself rare and usually an indication of a bug in your program.