Defines a Long class for representing a 64-bit two’s-complement integer value, which faithfully simulates the behavior of a Java “Long”. This implementation is derived from LongLib in GWT.
- low (number) – the low (signed) 32 bits of the Long.
- high (number) – the high (signed) 32 bits of the Long.
Constructs a 64-bit two’s-complement integer, given its low and high 32-bit values as signed integers. See the from* functions below for more convenient ways of constructing Longs.
In the algorithms below, we frequently reduce the negative case to the positive case by negating the input(s) and then post-processing the result. Note that we must ALWAYS check specially whether those values are MIN_VALUE (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as a positive number, it overflows back into a negative). Not handling this case would often result in infinite recursion.