Module arithmetic
Source - AbsChecked
- Unary operator for retrieving the absolute value, enforcing an overflow never occurs.
- AbsSaturating
- Unary operator for retrieving the absolute value, bounding the difference to
MAX
if an overflow occurs. - AbsWrapped
- Unary operator for retrieving the absolute value, wrapping the result if an overflow occurs.
- AddChecked
- Binary operator for adding two values, enforcing an overflow never occurs.
- AddSaturating
- Binary operator for adding two values, bounding the sum to
MAX
if an overflow occurs. - AddWrapped
- Binary operator for adding two values, wrapping the sum if an overflow occurs.
- DivChecked
- Binary operator for dividing two values, enforcing an overflow never occurs.
- DivSaturating
- Binary operator for dividing two values, bounding the quotient to
MAX
or MIN
if an overflow occurs. - DivUnchecked
- Binary operator for dividing two values, without checking specific conditions.
- DivWrapped
- Binary operator for dividing two values, wrapping the quotient if an overflow occurs.
- Double
- Unary operator for retrieving the doubled value.
- Inverse
- Unary operator for retrieving the inverse value.
- Modulo
- Binary operator for modding two values.
- MulChecked
- Binary operator for multiplying two values, enforcing an overflow never occurs.
- MulSaturating
- Binary operator for multiplying two values, bounding the product to
MAX
if an overflow occurs. - MulWrapped
- Binary operator for multiplying two values, wrapping the product if an overflow occurs.
- PowChecked
- Binary operator for exponentiating two values, enforcing an overflow never occurs.
- PowWrapped
- Binary operator for exponentiating two values, wrapping the result if an overflow occurs.
- RemChecked
- Binary operator for dividing two values and returning the remainder, enforcing an overflow never occurs.
- RemSaturating
- Binary operator for dividing two values, bounding the remainder to
MAX
or MIN
if an overflow occurs. - RemWrapped
- Binary operator for dividing two values, wrapping the remainder if an overflow occurs.
- ShlChecked
- Binary operator for left shifting a value, checking that the rhs is less than the number
of bits in self.
- ShlWrapped
- Binary operator for left shifting a value, safely continuing past the number of bits in self.
- ShrChecked
- Binary operator for right shifting a value, checking that the rhs is less than the number
of bits in self.
- ShrWrapped
- Binary operator for right shifting a value, safely continuing past the number of bits in self.
- Square
- Unary operator for retrieving the squared value.
- SquareRoot
- Unary operator for retrieving the square root of the value.
- SubChecked
- Binary operator for subtracting two values, enforcing an underflow never occurs.
- SubSaturating
- Binary operator for subtracting two values, bounding the difference to
MIN
if an underflow occurs. - SubWrapped
- Binary operator for subtracting two values, wrapping the difference if an underflow occurs.