IntX class abstract
A fixed-precision integer.
- Implemented types
Constructors
- IntX()
Properties
- bitLength → int
-
Returns the minimum number of bits required to store this integer.
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- isEven → bool
-
Returns
trueif and only if this integer is even.no setter - isMaxValue → bool
-
Returns
trueif and only if this integer is the maximum signed value that can be represented within its bit size.no setter - isMinValue → bool
-
Returns
trueif and only if this integer is the minimum signed value that can be represented within its bit size.no setter - isNegative → bool
-
Returns
trueif and only if this integer is less than zero.no setter - isOdd → bool
-
Returns
trueif and only if this integer is odd.no setter - isZero → bool
-
Returns
trueif and only if this integer is zero.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
abs(
) → IntX - Returns the absolute value of this integer.
-
clamp(
Object lowerLimit, Object upperLimit) → IntX -
Clamps this integer to be in the range
lowerLimit-upperLimit. -
compareTo(
Object other) → int -
Compares this object to another object.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
numberOfLeadingZeros(
) → int - Returns the number of high-order zeros in this integer's bit representation.
-
numberOfTrailingZeros(
) → int - Returns the number of low-order zeros in this integer's bit representation.
-
remainder(
Object other) → IntX -
Returns the remainder of the truncating division of this integer by
other. -
shiftRightUnsigned(
int shiftAmount) → IntX - Unsigned right-shift operator.
-
toBytes(
) → List< int> - Returns a byte-sequence representation of this integer.
-
toDouble(
) → double - Returns the double representation of this integer.
-
toHexString(
) → String - Returns a string representing the value of this integer in hexadecimal notation.
-
toInt(
) → int - Returns the int representation of this integer.
-
toInt32(
) → Int32 - Returns an Int32 representation of this integer.
-
toInt64(
) → Int64 - Returns an Int64 representation of this integer.
-
toRadixString(
int radix) → String - Returns a string representing the value of this integer in the given radix.
-
toSigned(
int width) → IntX -
Returns the least significant
widthbits of this integer, extending the highest retained bit to the sign. This is the same as truncating the value to fit inwidthbits using an signed 2-s complement representation. The returned value has the same bit value in all positions higher thanwidth. -
toString(
) → String -
Returns a string representing the value of this integer in decimal
notation; example:
'13'.override -
toUnsigned(
int width) → IntX -
Returns the least significant
widthbits of this integer as a non-negative number (i.e. unsigned representation). The returned value has zeros in all bit positions higher thanwidth.
Operators
-
operator %(
Object other) → IntX - Euclidean modulo operator.
-
operator &(
Object other) → IntX - Bitwise and operator.
-
operator *(
Object other) → IntX - Multiplication operator.
-
operator +(
Object other) → IntX - Addition operator.
-
operator -(
Object other) → IntX - Subtraction operator.
-
operator <(
Object other) → bool - Relational less than operator.
-
operator <<(
int shiftAmount) → IntX - Left bit-shift operator.
-
operator <=(
Object other) → bool - Relational less than or equal to operator.
-
operator ==(
Object other) → bool -
Returns
trueif and only ifotheris an int or IntX equal in value to this integer.override -
operator >(
Object other) → bool - Relational greater than operator.
-
operator >=(
Object other) → bool - Relational greater than or equal to operator.
-
operator >>(
int shiftAmount) → IntX - Right bit-shift operator.
-
operator ^(
Object other) → IntX - Bitwise xor operator.
-
operator unary-(
) → IntX - Negate operator.
-
operator |(
Object other) → IntX - Bitwise or operator.
-
operator ~(
) → IntX - Bitwise negate operator.
-
operator ~/(
Object other) → IntX - Truncating division operator.