ux class
Unsigned Integer with custom bit-width
0
to (2 ^ bitWidth) - 1
Constructors
- ux({required int bits, required int value})
- Signed Integer with custom bit-width
- ux.fromEnvironment(String name, {required int bits, int defaultValue = 0})
-
Returns the integer value of the given environment declaration
name
.factory - ux.integer(integer val, {required int bits})
-
Create
ux
from anotherinteger
value - ux.parse(String source, {required int bits})
-
Parse
source
as a, possibly signed, integer literal and return its value.
Properties
- bits → int
-
Bitwidth of this integer. This is same as
bitLength
no setter - hashCode ↔ int
-
The hash code for this object.
getter/setter pairinherited
- 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
-
Value of the integer
no setterinherited
Methods
-
ceilToDouble(
) → double -
Returns
this.toDouble()
.inherited -
compareTo(
integer other) → int -
Compares this object to another object.
inherited
-
copy(
{int? bits, int? value}) → ux -
Copy
ux
with the provided arguments -
floorToDouble(
) → double -
Returns
this.toDouble()
.inherited -
gcd(
integer other) → ux -
Returns the greatest common divisor of this integer and
other
.override -
modInverse(
unsigned modulus) → ux -
Returns the modular multiplicative inverse of this integer
modulo
modulus
.override -
modPow(
unsigned exponent, unsigned modulus) → ux -
Returns this integer to the power of
exponent
modulomodulus
.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
ofSameBit(
int value) → ux -
Create another
ux
with the provided value -
remainder(
dynamic other) → ux -
The remainder of the truncating division of
this
byother
.override -
roundToDouble(
) → double -
Returns
this.toDouble()
.inherited -
toRadixString(
int radix) → String -
Converts this to a string representation in the given
radix
.inherited -
toString(
) → String -
Returns a string representation of this integer.
inherited
-
truncateToDouble(
) → double -
Returns
this.toDouble()
.inherited
Operators
-
operator %(
dynamic other) → ux -
Euclidean modulo of this number by
other
.override -
operator &(
dynamic other) → ux -
Bit-wise and operator.
override
-
operator *(
dynamic other) → ux -
Multiplies this integer by
other
.override -
operator +(
dynamic other) → ux -
Adds
other
to this number.override -
operator -(
dynamic other) → ux -
Subtracts
other
from this number.override -
operator /(
dynamic other) → double -
Divides this number by
other
.inherited -
operator <(
dynamic other) → bool -
Whether this number is numerically smaller than
other
.inherited -
operator <<(
dynamic other) → ux -
Shift the bits of this integer to the left by
shiftAmount
.override -
operator <=(
dynamic other) → bool -
Whether this number is numerically smaller than or equal to
other
.inherited -
operator ==(
Object other) → bool -
Test whether this value is numerically equal to other.
inherited
-
operator >(
dynamic other) → bool -
Whether this number is numerically greater than
other
.inherited -
operator >=(
dynamic other) → bool -
Whether this number is numerically greater than or equal to
other
.inherited -
operator >>(
dynamic other) → ux -
Shift the bits of this integer to the right by
shiftAmount
.override -
operator >>>(
dynamic other) → ux -
Bitwise unsigned right shift by
shiftAmount
bits.override -
operator ^(
dynamic other) → ux -
Bit-wise exclusive-or operator.
override
-
operator unary-(
) → ix -
Return the negative value of this integer.
override
-
operator |(
dynamic other) → ux -
Bit-wise or operator.
override
-
operator ~(
) → ix -
The bit-wise negate operator.
override
-
operator ~/(
dynamic other) → ux -
Truncating division operator.
override