-
<static> fromInt(value)
-
Returns a Long representing the given (32-bit) integer value.
Parameters:
Name |
Type |
Description |
value |
number
|
The 32-bit integer in question. |
Returns:
The corresponding Long value.
-
Type
-
Long
-
<static> fromNumber(value)
-
Returns a Long representing the given value, provided that it is a finite
number. Otherwise, zero is returned.
Parameters:
Name |
Type |
Description |
value |
number
|
The number in question. |
Returns:
The corresponding Long value.
-
Type
-
Long
-
<static> fromBits(lowBits, highBits)
-
Returns a Long representing the 64-bit integer that comes by concatenating
the given high and low bits. Each is assumed to use 32 bits.
Parameters:
Name |
Type |
Description |
lowBits |
number
|
The low 32-bits. |
highBits |
number
|
The high 32-bits. |
Returns:
The corresponding Long value.
-
Type
-
Long
-
compare()
-
Compares this Long with the given one.
Returns:
0 if they are the same, 1 if the this is greater, and -1
if the given one is greater.
-
Type
-
number
-
negate()
-
Return the negation
Returns:
The negation of this value.
-
Type
-
Long
-
add(other)
-
Returns the sum of this and the given Long.
Parameters:
Name |
Type |
Description |
other |
Long
|
Long to add to this one. |
Returns:
The sum of this and the given Long.
-
Type
-
Long
-
subtract(other)
-
Returns the difference of this and the given Long.
Parameters:
Name |
Type |
Description |
other |
Long
|
Long to subtract from this. |
Returns:
The difference of this and the given Long.
-
Type
-
Long
-
multiply(other)
-
Returns the product of this and the given long.
Parameters:
Name |
Type |
Description |
other |
Long
|
Long to multiply with this. |
Returns:
The product of this and the other.
-
Type
-
Long
-
and(other)
-
Returns the bitwise-AND of this Long and the given one.
Parameters:
Name |
Type |
Description |
other |
Long
|
The Long with which to AND. |
Returns:
The bitwise-AND of this and the other.
-
Type
-
Long
-
or(other)
-
Returns the bitwise-OR of this Long and the given one.
Parameters:
Name |
Type |
Description |
other |
Long
|
The Long with which to OR. |
Returns:
The bitwise-OR of this and the other.
-
Type
-
Long
-
shiftRightUnsigned(numBits)
-
Returns this Long with bits shifted to the right by the given amount, with
the new top bits matching the current sign bit.
Parameters:
Name |
Type |
Description |
numBits |
number
|
The number of bits by which to shift. |
Returns:
This shifted to the right by the given amount, with
zeros placed into the new leading bits.
-
Type
-
Long