I have looked everywhere but I couldnt find any information related to this topic. Also, Is there a java - like Long / BigDecimal datatype in dart?
Dart 2
For dart2js generated JavaScript Pixel Elephants answer is still true.
within the range -253 to 253
Other execution platforms have fixed-size integers with 64 bits.
The type BigInt
was added to typed_data
Since Dart 2.0 will switch to fixed-size integers, we also added a
BigInt
class to thetyped_data
library. Developers targeting dart2js can use this class as well. TheBigInt
class is not implementing num, and is completely independent of the num hierarchy.
Dart 1
There are also the packages
- https://pub.dartlang.org/packages/bignum
- https://pub.dartlang.org/packages/decimal
That depends if you are running in the Dart VM or compiling to JavaScript.
On the Dart VM an int
is arbitrary precision and has no limit.
When compiling to JavaScript you are actually using floating point numbers, since that is all that JavaScript supports. This means you are restricted to representing integers within the range -253 to 253