|
NTLib - Number Theory Library 0.9
|
Class representing an element of a ring of integers modulo another positive integer. The modulus is provided at compile-time. More...
Public Member Functions | |
| mod_int () noexcept | |
| Default constructor. Initializes the value to zero. | |
| mod_int (T n) noexcept | |
| Construct a new element from a given value. | |
| operator T () const noexcept | |
| Returns the value. | |
| mod_int & | operator++ () noexcept |
| Prefix increment operator. | |
| mod_int | operator++ (int) noexcept |
| Postfix increment operator. | |
| mod_int & | operator-- () noexcept |
| Prefix decrement operator. | |
| mod_int | operator-- (int) noexcept |
| Postfix decrement operator. | |
| mod_int & | operator+= (mod_int rhs) noexcept |
| Compound plus operator for modular addition. | |
| mod_int & | operator-= (mod_int rhs) noexcept |
| Compound minus operator for modular subtraction. | |
| mod_int & | operator*= (mod_int rhs) noexcept |
| Compound times operator for modular multiplication. | |
| mod_int | operator+ () const noexcept |
| Unary plus operator. Does nothing. | |
| mod_int | operator- () const noexcept |
| Unary minus operator to negate value. | |
| void | invert () |
| Inverts the value. | |
Friends | |
| mod_int | operator+ (mod_int lhs, mod_int rhs) noexcept |
| Plus operator for modular addition. | |
| mod_int | operator- (mod_int lhs, mod_int rhs) noexcept |
| Minus operator for modular subtraction. | |
| mod_int | operator* (mod_int lhs, mod_int rhs) noexcept |
| Times operator for modular multiplication. | |
| bool | operator== (mod_int lhs, mod_int rhs) noexcept |
| Equality comparison operator. | |
Class representing an element of a ring of integers modulo another positive integer. The modulus is provided at compile-time.
| T | An integer-like type. |
| m | The modulus. |
|
inlineexplicitnoexcept |
Construct a new element from a given value.
| n | The given value. |
|
inline |
Inverts the value.
|
inlineexplicitnoexcept |
Returns the value.
|
inlinenoexcept |
Compound times operator for modular multiplication.
| rhs | The second factor. |
|
inlinenoexcept |
Unary plus operator. Does nothing.
|
inlinenoexcept |
Prefix increment operator.
|
inlinenoexcept |
Postfix increment operator.
|
inlinenoexcept |
Compound plus operator for modular addition.
| rhs | The second summand. |
|
inlinenoexcept |
Unary minus operator to negate value.
|
inlinenoexcept |
Prefix decrement operator.
|
inlinenoexcept |
Postfix decrement operator.
|
inlinenoexcept |
Compound minus operator for modular subtraction.
| rhs | The subtrahend. |
Times operator for modular multiplication.
| lhs | The first factor. |
| rhs | The second factor. |
Plus operator for modular addition.
| lhs | The first summand. |
| rhs | The second summand. |
Minus operator for modular subtraction.
| lhs | The minuend. |
| rhs | The subtrahend. |
Equality comparison operator.
| lhs | The first instance. |
| rhs | The second instance. |