|
NTLib - Number Theory Library 0.9
|
Function templates for modular arithmetic. More...
Functions | |
| template<Integer T> | |
| constexpr T | ntlib::floor_div (T a, T b) noexcept |
| Returns the rounded down quotient of two given numbers. | |
| template<Integer T> | |
| constexpr T | ntlib::ceil_div (T a, T b) noexcept |
| Returns the rounded up quotient of two given numbers. | |
| template<Integer T> | |
| constexpr T | ntlib::mod (T a, T m) noexcept |
| The mathematical modulo operation. | |
| template<MultiplicativeMonoid A, Integer B, Integer M, std::invocable< A, M > MF> | |
| constexpr A | ntlib::mod_pow (A a, B b, M m, MF mod_func) noexcept |
| Binary exponentiation with a custom mod-function and modulus. | |
| template<Integer T> | |
| constexpr T | ntlib::mod_mult_inv (T a, T m) noexcept |
| Computes the multiplicative inverse. | |
| template<Integer T> | |
| constexpr bool | ntlib::mod_is_square (T a, T p) noexcept |
| Test whether a given number is a quadratic residue module a prime. | |
| template<Integer T> | |
| constexpr T | ntlib::mod_sqrt (T n, T p) noexcept |
| Computes square roots moduolo an odd prime. | |
| template<Integer T> | |
| constexpr T | ntlib::mod_factorial (T n, T m) |
| Computes a factorial modulo a given number. | |
| template<Integer T> | |
| constexpr T | ntlib::legendre (T a, T p) noexcept |
| Computes the Legendre Symbol. | |
| template<Integer T> | |
| constexpr T | ntlib::jacobi (T a, T b) noexcept |
| Computes the Jacobi Symbol \(\left(\frac{a}{p}\right)\). | |
Function templates for modular arithmetic.
Files | |
| file | modules/base/modulo.cpp |
| Primary module interface unit for module modulo. | |