Comments (3)
@jamesderlin thanks for this issue. I feel like the implementation is likely also not correct in that case because (at least from what I understand), the goal of Int64
should be to emulate the behavior of Dart's int
in native (just adding web support), but it does not work that way.
Instead, any overflow of Int64
results in -2476544402191318784
, unfortunately (so no matter the overflow, you always get that number on web. On native, it works correctly.
from fixnum.
the goal of Int64 should be to emulate the behavior of Dart's int in native (just adding web support), but it does not work that way.
I switched roles at work ~5 years ago and don't work on this package any more, but that wasn't the goal when we wrote this package, mostly because at the time Dart's int
behaviour on the VM was effectively the same as Python integers. The Dart int
type moved to 64-bit integers long after this package went stable. It probably should be the goal now, but we have backward compatibility to worry about, so we'd want to be very careful with any changes to the semantics other than bugfixes.
Instead, any overflow of Int64 results in -2476544402191318784, unfortunately (so no matter the overflow, you always get that number on web. On native, it works correctly.
Can you file this as a separate bug and link here? The goal of the package is to have the same behaviour on the web and VM; if that's not happening, then it's a bug. We should add additional cases to the overflow tests.
from fixnum.
Instead, any overflow of
Int64
results in-2476544402191318784
, unfortunately (so no matter the overflow, you always get that number on web. On native, it works correctly.
@creativecreatorormaybenot I don't think that I've observed that. Do you have a specific reproduction case?
from fixnum.
Related Issues (20)
- publish a new version of fixnum w/ the 2.19 min HOT 2
- Better representation of Int64 on platforms that support unboxed int64 integers HOT 2
- Add toDoubleUnsigned() method
- Provide simple conversions between Int64 and BigInt. HOT 3
- Incorrect int64 conversion when compiled to JavaScript? HOT 1
- Remove operator== considering Int64 == core.int HOT 8
- Int64.parseInt doesn't check for overflow, nor do its docs explain what happens HOT 1
- Fix travis + dart2js failures with Dart 2
- Int64.parseInt('') throws RangeError instead of FormatException HOT 3
- Question: How are 64-bit integers supported on 32-bit platforms? HOT 2
- Use Typed-Data lists instead of generic lists for byte-conversion HOT 2
- Max value to int is min value on web HOT 2
- Migrate off the deprecated List constructor HOT 1
- CI results don't match local result for `dart analyze` HOT 2
- BigInt performance comparison HOT 7
- Int64 is broken on web HOT 4
- Int32 operators require casts and are inconsistent with Int64 HOT 1
- fixnum classes could be much more performant when targeting the Dart VM HOT 5
- Add `tryParse` methods
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fixnum.