Long class

限制int为64位Long

Inheritance

Constructors

Long(int num)

Properties

bitLength int
Returns the minimum number of bits required to store this integer.
no setterinherited
bits int
返回bit位数
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
isEven bool
Returns true if and only if this integer is even.
no setterinherited
isOdd bool
Returns true if and only if this integer is odd.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sign int
Returns the sign of this integer.
no setterinherited
value int
实际值
no setteroverride

Methods

abs() Long
Returns the absolute value of this integer.
inherited
byteValue() Byte
以byte形式返回指定数字的值
inherited
ceil() Long
Returns this.
inherited
ceilToDouble() double
Returns this.toDouble().
inherited
compareTo(Long other) int
Compares this object to another object.
inherited
doubleValue() double
以double形式返回指定数字的值
inherited
floor() Long
Returns this.
inherited
floorToDouble() double
Returns this.toDouble().
inherited
gcd(int other) Long
Returns the greatest common divisor of this integer and other.
inherited
intValue() Integer
以int形式返回指定数字的值
inherited
longValue() Long
以long形式返回指定数字的值
inherited
modInverse(int modulus) Long
Returns the modular multiplicative inverse of this integer modulo modulus.
inherited
modPow(int exponent, int modulus) Long
Returns this integer to the power of exponent modulo modulus.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
round() Long
Returns this.
inherited
roundToDouble() double
Returns this.toDouble().
inherited
shortValue() Short
以short形式返回指定数字的值
inherited
toRadixString(int radix) String
Converts this to a string representation in the given radix.
inherited
toSigned(int width) int
Returns the least significant width bits of this integer, extending the highest retained bit to the sign. This is the same as truncating the value to fit in width bits using an signed 2-s complement representation. The returned value has the same bit value in all positions higher than width.
inherited
toString() String
Returns a string representation of this integer.
inherited
toUnsigned(int width) int
Returns the least significant width bits of this integer as a non-negative number (i.e. unsigned representation). The returned value has zeros in all bit positions higher than width.
inherited
truncate() Long
Returns this.
inherited
truncateToDouble() double
Returns this.toDouble().
inherited
uByteValue() int
以无符号byte形式返回指定数字的值
inherited
uIntValue() int
以无符号int形式返回指定数字的值
inherited
uLongValue() int
以无符号long形式返回指定数字的值
inherited
uShortValue() int
以无符号short形式返回指定数字的值
inherited
valueOf(int num) Long
创建实例
override

Operators

operator %(dynamic other) Long
取模
inherited
operator &(dynamic other) Long
位和运算符。 将thisother都视为足够大的二进制分量整数,结果是一个数字,其中只有在thisother中设置的位集 如果两个操作数都为负,则结果为负,否则结果为非负
inherited
operator *(dynamic other) Long
乘法,结果超出bits时,将溢出范围,具体参考toSigned
inherited
operator +(dynamic other) Long
加法,结果超出bits时,将溢出范围,具体参考toSigned
inherited
operator -(dynamic other) Long
减法
inherited
operator /(dynamic other) double
除法
inherited
operator <(dynamic other) bool
小于
inherited
operator <<(dynamic other) Long
将此整数的位向左shiftAmount 。 向左移动会使数字变大,有效地将数字乘以pow(2, shiftIndex) 。 结果的大小没有限制。通过使用带有合适掩码的“and”运算符来限制中间值可能是相关的。 如果shiftAmount为负数,则为错误 结果超出bits时,将溢出范围,具体参考toSigned
inherited
operator <=(dynamic other) bool
小于等于
inherited
operator ==(Object other) bool
相等
inherited
operator >(dynamic other) bool
大于
inherited
operator >=(dynamic other) bool
大于等于
inherited
operator >>(dynamic other) Long
将此整数的位向右shiftAmount 。 向右移动会使数字变小并丢弃最低有效位,从而有效地进行pow(2, shiftIndex)的整数除法。 如果shiftAmount为负数,则为错误
inherited
operator >>>(dynamic other) Long
按位无符号右移shiftAmount位。 最不重要的shiftAmount位被删除,其余位(如果有)被向下移动,并且零位被移入作为新的最高有效位。 shiftAmount必须为非负数
inherited
operator ^(dynamic other) Long
按位异或运算符。 将thisother都视为足够大的二进制分量整数,结果是一个数字,其位集设置在thisother的一个中,但不是同时设置 如果操作数的符号相同,则结果为非负数,否则结果为负数
inherited
operator unary-() Long
负数
inherited
operator |(dynamic other) Long
按位或运算符。 将thisother都视为足够大的二进制分量整数,结果是一个数字,其位集在thisother中的任何一个中设置 如果两个操作数都是非负数,则结果为非负数,否则结果为负数
inherited
operator ~() Long
按位取反运算符。 将this视为足够大的二进制分量整数,结果是设置了相反位的数字。 这将任何整数x映射到-x - 1
inherited
operator ~/(dynamic other) Long
除法取整
inherited

Constants

maxValue → const int
最大值
minValue → const int
最小值