On a modern processor, if you limit your integer values to the range + - 2 ^ 52, then using double will be slightly less efficient than using long .
The double type IEE754 has 53 bits of mantissa, so you can easily imagine a 32-bit integer range, and then some.
In any case, the rest of the Javascript will be a much more bottleneck than the individual processor instructions used to process arithmetic.
source share