,
line 43Defines 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.
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.
The internal representation of a Long is the two given signed, 32-bit values.
We use 32-bit pieces because these are the size of integers on which
Javascript performs bit-operations. For operations like addition and
multiplication, we split each number into 16-bit pieces, which can easily be
multiplied within Javascript's floating-point representation without overflow
or change in sign.
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.
low
number
the low (signed) 32 bits of the Long.
high
number
the high (signed) 32 bits of the Long.
,
line 724Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.
Name Type Descriptionvalue
bigint
The number in question
,
line 736Returns a Long representing the 64-bit integer that comes by concatenating the given high and low bits. Each is assumed to use 32 bits.
Name Type DescriptionlowBits
number
the low 32-bits.
highBits
number
the high 32-bits.
,
line 683Returns a Long representing the given (32-bit) integer value.
Name Type Descriptionvalue
number
the 32-bit integer in question.
,
line 705Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.
Name Type Descriptionvalue
number
the number in question.
,
line 748Returns a Long representation of the given string, written using the given radix.
Name Type Descriptionstr
string
the textual representation of the Long.
opt_radix
number
the radix in which the text is written.
,
line 349Returns the sum of this and the given Long.
Name Type Descriptionother
Long
Long to add to this one.
,
line 582Returns the bitwise-AND of this Long and the given one.
Name Type Descriptionother
Long
the Long with which to AND.
,
line 306Compares this Long with the given one.
Name Type Descriptionother
Long
Long to compare against.
,
line 475Returns this Long divided by the given one.
Name Type Descriptionother
Long
Long by which to divide.
,
line 240Return whether this Long equals the other
Name Type Descriptionother
Long
Long to compare against.
,
line 155Return the high 32-bits value.
,
line 165Return the low 32-bits value.
,
line 175Return the low unsigned 32-bits value.
,
line 185Returns the number of bits needed to represent the absolute value of this Long.
,
line 284Return whether this Long is greater than the other.
Name Type Descriptionother
Long
Long to compare against.
,
line 295Return whether this Long is greater than or equal to the other.
Name Type Descriptionother
Long
Long to compare against.
,
line 219Return whether this value is negative.
,
line 229Return whether this value is odd.
,
line 209Return whether this value is zero.
,
line 262Return whether this Long is less than the other.
Name Type Descriptionother
Long
Long to compare against.
,
line 273Return whether this Long is less than or equal to the other.
Name Type Descriptionother
Long
Long to compare against.
,
line 561Returns this Long modulo the given one.
Name Type Descriptionother
Long
Long by which to mod.
,
line 398Returns the product of this and the given Long.
Name Type Descriptionother
Long
Long to multiply with this.
,
line 334The negation of this value.
,
line 571The bitwise-NOT of this value.
,
line 251Return whether this Long does not equal the other.
Name Type Descriptionother
Long
Long to compare against.
,
line 593Returns the bitwise-OR of this Long and the given one.
Name Type Descriptionother
Long
the Long with which to OR.
,
line 615Returns this Long with bits shifted to the left by the given amount.
Name Type DescriptionnumBits
number
the number of bits by which to shift.
,
line 637Returns this Long with bits shifted to the right by the given amount.
Name Type DescriptionnumBits
number
the number of bits by which to shift.
,
line 659Returns this Long with bits shifted to the right by the given amount, with the new top bits matching the current sign bit.
Name Type DescriptionnumBits
number
the number of bits by which to shift.
,
line 387Returns the difference of this and the given Long.
Name Type Descriptionother
Long
Long to subtract from this.
,
line 81Converts the Long to a BigInt (arbitrary precision).
,
line 66Return the int value.
,
line 91Return the JSON value.
,
line 76Return the Number value.
,
line 102Return the String value.
Name Type Descriptionopt_radix
number optional
the radix in which the text should be written.
,
line 604Returns the bitwise-XOR of this Long and the given one.
Name Type Descriptionother
Long
the Long with which to XOR.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4