Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as signed integers. 构造一个64位2的补全整数,将其低位和高位32位值作为有符号整数。See the from* functions below for more convenient ways of constructing Longs.有关构造Long的更方便方法,请参阅下面的from*函数。
Acceptable signatures are:可接受的签名为:
The low (signed) 32 bits of the long长的低(带符号)32位
The high (signed) 32 bits of the long长的高(带符号)32位
Whether unsigned or not, defaults to signed无论是否未签名,默认为已签名
An indicator used to reliably determine if an object is a Long or not.用于可靠确定对象是否为Long的指示符。
The high 32 bits as a signed value.高32位作为有符号值。
The low 32 bits as a signed value.低32位作为有符号值。
Whether unsigned or not.无论是否未签名。
Maximum unsigned value.最大无符号值。
Maximum signed value.最大有符号值。
Minimum signed value.最小有符号值。
Signed negative one.有符号的负数。
Signed one.签名一。
Unsigned one.未签名的。
Unsigned zero.无符号零。
Signed zero有符号零
This is an alias of Long.compare这是Long.compare的别名
This is an alias of Long.divide这是Long.divide
的别名
This is an alias of Long.equals这是Long.equals
的别名
This is an alias of Long.isZero这是Long.isZero
的别名
This is an alias of 这是Long.greaterThanOrEqual
的别名
Gets the high 32 bits as a signed integer.获取高位32位作为有符号整数。
Gets the high 32 bits as an unsigned integer.获取高位32位作为无符号整数。
Gets the low 32 bits as a signed integer.获取低32位作为有符号整数。
Gets the low 32 bits as an unsigned integer.获取低32位作为无符号整数。
Gets the number of bits needed to represent the absolute value of this Long.获取表示此Long的绝对值所需的位数。
This is an alias of 这是Long.greaterThan
的别名
This is an alias of 这是Long.greaterThanOrEqual
的别名
Tests if this Long's value is even.测试此Long的值是否为偶数。
Tests if this Long's value is negative.测试此Long的值是否为负值。
Tests if this Long's value is odd.测试此Long的值是否为奇数。
Tests if this Long's value is positive.测试此Long的值是否为正。
Tests if this Long's value equals zero.测试此Long的值是否等于零。
This is an alias of 这是Long.lessThanOrEqual
的别名
This is an alias of Long.lessThan.这是Long.lessThan
的别名。
This is an alias of 这是Long.lessThanOrEqual
的别名
This is an alias of 这是Long.modulo
的别名
This is an alias of 这是Long.multiply
的别名
This is an alias of 这是Long.notEquals
的别名
This is an alias of 这是Long.negate
的别名
Returns the Negation of this Long's value.返回此Long值的否定值。
This is an alias of 这是Long.notEquals
的别名
Returns the bitwise NOT of this Long.返回此Long的按位NOT。
This is an alias of 这是Long.modulo
的别名
This is an alias of 这是Long.shiftLeft
的别名
This is an alias of 这是Long.shiftRight
的别名
This is an alias of 这是Long.shiftRightUnsigned
的别名
This is an alias of 这是Long.shiftRightUnsigned
的别名
This is an alias of 这是Long.subtract
的别名
Converts the Long to a BigInt (arbitrary precision).将Long转换为BigInt(任意精度)。
Converts this Long to its byte representation.将此Long转换为其字节表示形式。
Whether little or big endian, defaults to big endian无论是小端还是大端,默认为大端
Byte representation
Converts this Long to its big endian byte representation.将此Long转换为其大端字节表示形式。
Big endian byte representation大端字节表示
Converts this Long to its little endian byte representation.将此Long转换为其小端字节表示形式。
Little endian byte representation小端字节表示
Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.将Long转换为32位整数,假定它是32位整数。
Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).将“长”转换为此值的最近浮点表示形式(双精度,53位尾数)。
Converts this Long to signed.将此Long转换为有符号。
Converts the Long to a string written in the specified radix.将Long转换为以指定基数写入的字符串。
Radix (2-36), defaults to 10基数(2-36),默认为10
Converts this Long to unsigned.将此Long转换为无符号。
Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.返回表示给定值的Long,前提是它是一个有限数。否则,返回零。
The number in question有问题的数字
Whether unsigned or not, defaults to signed是否有符号,默认为有符号
The corresponding Long value对应的Long值
Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. 返回一个Long,表示通过连接给定的低位和高位而得到的64位整数。Each is assumed to use 32 bits.假设每个都使用32位。
The low 32 bits低32位
The high 32 bits高32位
Whether unsigned or not, defaults to signed无论是否未签名,默认为已签名
The corresponding Long value对应的Long值
Creates a Long from its byte representation.从字节表示创建Long。
Byte representation字节表示法
Whether unsigned or not, defaults to signed无论是否未签名,默认为已签名
Whether little or big endian, defaults to big endian无论是小端还是大端,默认为大端
The corresponding Long value对应的Long值
Creates a Long from its big endian byte representation.从其大端字节表示创建Long。
Big endian byte representation大端字节表示
Whether unsigned or not, defaults to signed是否有符号,默认为有符号
The corresponding Long value对应的Long值
Creates a Long from its little endian byte representation.从其小端字节表示创建Long。
Little endian byte representation小端字节表示
Whether unsigned or not, defaults to signed是否有符号,默认为有符号
The corresponding Long value对应的Long值
Returns a Long representing the given 32 bit integer value.返回表示给定32位整数值的Long。
The 32 bit integer in question有问题的32位整数
Whether unsigned or not, defaults to signed是否有符号,默认为有符号
The corresponding Long value对应的Long值
Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.返回表示给定值的Long,前提是它是一个有限数。否则,返回零。
The number in question有问题的数字
Whether unsigned or not, defaults to signed是否有符号,默认为有符号
The corresponding Long value对应的Long值
Returns a Long representation of the given string, written using the specified radix.返回给定字符串的长表示形式,使用指定的基数写入。
The textual representation of the LongLong的文本表示
Whether unsigned or not, defaults to signed是否有符号,默认为有符号
The radix in which the text is written (2-36), defaults to 10写入文本的基数(2-36),默认为10
The corresponding Long value对应的Long值
Converts the specified value to a Long.将指定的值转换为Long。
Whether unsigned or not, defaults to signed是否有符号,默认为有符号
Tests if the specified object is a Long.测试指定的对象是否为Long。
Generated using TypeDoc
A class representing a 64-bit integer表示64位整数的类The internal representation of a long is the two given signed, 32-bit values.long的内部表示形式是两个给定的32位有符号值。We use 32-bit pieces because these are the size of integers on which Javascript performs bit-operations.我们使用32位片段,因为它们是Javascript执行位操作的整数大小。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.对于加法和乘法等操作,我们将每个数字拆分为16位的部分,这些部分可以在Javascript的浮点表示中轻松地进行乘法运算,而不会溢出或改变符号。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).请注意,我们必须始终特别检查这些值是否为MIN_VALUE(-2^63),因为-MIN_VALUE==MIN_WALUE(由于2^63不能表示为正数,它会溢出返回负数)。Not handling this case would often result in infinite recursion.不处理这种情况通常会导致无限递归。Common constant values ZERO, ONE, NEG_ONE, etc. are found as static properties on this class.常见常数值ZERO、ONE、NEG_ONE等都是此类的静态属性。