RxIntExt extension
Extension providing additional functionality for int values wrapped in an Rx object.
Properties
Methods
-
abs(
) → int - Returns the absolute value of this integer.
-
ceilToDouble(
) → double -
Returns
this.toDouble()
. -
floorToDouble(
) → double -
Returns
this.toDouble()
. -
gcd(
int other) → int -
Returns the greatest common divisor of this integer and
other
. -
modInverse(
int modulus) → int -
Returns the modular multiplicative inverse of this integer
modulo
modulus
. -
modPow(
int exponent, int modulus) → int -
Returns this integer to the power of
exponent
modulomodulus
. -
roundToDouble(
) → double -
Returns
this.toDouble()
. -
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 inwidth
bits using an signed 2-s complement representation. The returned value has the same bit value in all positions higher thanwidth
. -
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 thanwidth
. -
truncateToDouble(
) → double -
Returns
this.toDouble()
.
Operators
-
operator &(
int other) → int - Bit-wise and operator.
-
operator <<(
int shiftAmount) → int -
Shift the bits of this integer to the left by
shiftAmount
. -
operator >>(
int shiftAmount) → int -
Shift the bits of this integer to the right by
shiftAmount
. -
operator ^(
int other) → int - Bit-wise exclusive-or operator.
-
operator unary-(
) → int - Return the negative value of this integer.
-
operator |(
int other) → int - Bit-wise or operator.
-
operator ~(
) → int - The bit-wise negate operator.