Minimum and maximum values of int type and double type

1,216 views
Skip to first unread message

Gen

unread,
Mar 30, 2012, 10:09:17 AM3/30/12
to General Dart Discussion
Hi,

does anyone know the minimum and maximum values of the int type and
double type ?

Are there variables defined in Dart to get these limit values
dynamically depending on the platform ?

Best regards

Ladislav Thon

unread,
Mar 30, 2012, 10:16:44 AM3/30/12
to Gen, General Dart Discussion
does anyone know the minimum and maximum values of the int type and
double type ?

Int is arbitrary-precision, so you can store all numbers that fit into your memory. There is no other limit per se (but I think that BigInts still have some implementation issues).

Double is a standard 64-bit floating point number. I vaguely recall seing constants for min and max value (and epsilon) for double, but I don't remember where exactly.

LT

Gen

unread,
Mar 30, 2012, 10:50:48 AM3/30/12
to General Dart Discussion
Thank you for your answer.

Given the keyword "arbitrary" I have easily found the corresponding
section in the specification. (Section 10.3 Numbers)

And the "double" corresponds to the "double" of the IEEE 754 standard.
After some tests, I have found that at least these values are possible
for double:
1e308
-1e308
1e-323
-1e-323

Gen

unread,
Mar 30, 2012, 11:03:33 AM3/30/12
to General Dart Discussion
According to the IEEE 7554 standard, the computations for "double" are
precise for at least 15 digits.
Practically:
1 - 0.0000000000000001 => 0.9999999999999999
but:
1 - 0.00000000000000001 => 1.0

Reply all
Reply to author
Forward
0 new messages