When getting rough with floating-point numbers, several constants come in handy, especially the "machine epsilon". (Note there is some confusion in definition of "machine epsilon" and "unit roundoff" - the definition below is the one we want and the one used in the C library.)

Proposals:

Number.EPSILON == 2^-52
The difference between 1 and the smallest value >1 that is representable as a floating-point number.

Number.MIN_NORMAL == 2^-1022
The minimum positive value that can be stored as an IEEE normal number.

Number.MAX_INTEGER == 2^53 - 1
The maximum integer value that can be stored in a number without losing precision.
(OK, so technically 2^53 can be stored, but that's an anomaly.)

Number.MAX_POWTWO == 2^1023
The maximum power-of-two that can be stored in a number.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to