Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as signed integers. 构造一个64位2的补码整数,将其低32位值和高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 longlong的低(有符号)32位
The high (signed) 32 bits of the longlong的高(有符号)32位
Whether unsigned or not, defaults to signed无论是否未签名,默认为已签名
An indicator used to reliably determine if an object is a Long or not.一种指示器,用于可靠地确定对象是否为长对象。
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.有符号-1。
Signed one.有符号1。
Unsigned one.无符号1
Unsigned zero.无符号0
Signed zero有符号0
This is an alias of Long.compare这是Long.compare的别名
This is an alias of 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这是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.获取表示此长度的绝对值所需的位数。
This is an alias of Long.greaterThan这是Long.greaterThan的别名
This is an alias of Long.greaterThanOrEqual这是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这是Long.lessThanOrEqual的别名
This is an alias of Long.lessThanOrEqual这是Long.lessThanOrEqual的别名
This is an alias of Long.modulo这是Long.modulo的别名
This is an alias of Long.multiply这是Long.multiply的别名
This is an alias of Long.notEquals这是Long.notEquals的别名
This is an alias of Long.negate这是Long.negate的别名
Returns the Negation of this Long's value.返回此Long值的反运算。
This is an alias of Long.notEquals这是Long.notEquals的别名
Returns the bitwise NOT of this Long.返回此长度的按位NOT。
This is an alias of Long.modulo这是Long.modulo的别名
This is an alias of Long.shiftLeft这是Long.shiftLeft的别名
This is an alias of Long.shiftRight这是Long.shiftRight的别名
This is an alias of Long.shiftRightUnsigned这是Long.shiftRightUnsigned的别名
This is an alias of Long.shiftRightUnsigned这是Long.shiftRightUnsigned的别名
This is an alias of Long.subtract这是Long.subtract的别名
Converts the Long to a BigInt (arbitrary precision).将Long转换为BigInt(任意精度)。
Converts this Long to its byte representation.将此长度转换为其字节表示形式。
Whether little or big endian, defaults to big endian无论是小端还是大端,默认为大端
Byte representation
Converts this Long to its big endian byte representation.将此长度转换为其大端字节表示形式。
Big endian byte representation大端字节表示法
Converts this Long to its little endian byte representation.将此长度转换为其小端字节表示形式。
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).将Long转换为该值的最接近的浮点表示形式(双精度,53位尾数)。
Converts this Long to signed.将此长度转换为已签名。
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.将此长度转换为无符号。
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对应的长值
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对应的长值
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对应的长值
Creates a Long from its big endian byte representation.从其big-endian字节表示形式创建Long。
Big endian byte representation大端字节表示法
Whether unsigned or not, defaults to signed无论是否未签名,默认为已签名
The corresponding Long value
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对应的长值
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对应的长值
Returns a Long representing the given value, provided that it is a finite number. 返回表示给定值的Long,前提是它是有限数。Otherwise, zero is returned.否则,返回零。
The number in question有问题的数字
Whether unsigned or not, defaults to signed无论是否未签名,默认为已签名
The corresponding Long value对应的长值
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对应的长值
Converts the specified value to a Long.将指定的值转换为Long。
Whether unsigned or not, defaults to signed无论是否未签名,默认为已签名
Tests if the specified object is a 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_值(-2^63),因为-MIN_VALUE == MIN_VALUE(因为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等是此类的静态属性。