IntX class Null safety

A fixed-precision integer.

Implemented types
Implementers

Constructors

IntX()

Properties

bitLength int
Returns the minimum number of bits required to store this integer. [...]
read-only
hashCode int
The hash code for this object. [...]
read-only, override
isEven bool
Returns true if and only if this integer is even.
read-only
isMaxValue bool
Returns true if and only if this integer is the maximum signed value that can be represented within its bit size.
read-only
isMinValue bool
Returns true if and only if this integer is the minimum signed value that can be represented within its bit size.
read-only
isNegative bool
Returns true if and only if this integer is less than zero.
read-only
isOdd bool
Returns true if and only if this integer is odd.
read-only
isZero bool
Returns true if and only if this integer is zero.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

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 non-existent 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; example: '0xd'.
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 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. [...]
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 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. [...]

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 true if and only if other is 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.