TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
Simple implementation of modular multiplicative inverse More...
#include <cassert>
#include <cstdint>
#include <iostream>
Go to the source code of this file.
Functions | |
uint64_t | imod (uint64_t x, uint64_t y) |
for assert | |
static void | test () |
self-test implementations | |
int | main () |
Main function. | |
Simple implementation of modular multiplicative inverse
this algorithm calculates the modular inverse x^{-1} \mod y iteratively
Definition in file modular_inverse_simple.cpp.
uint64_t imod | ( | uint64_t | x, |
uint64_t | y ) |
for assert
for IO operations
Function imod Calculates the modular inverse of x with respect to y, x^{-1} \mod y
x | number |
y | number |
Definition at line 21 of file modular_inverse_simple.cpp.
int main | ( | void | ) |
|
static |
self-test implementations
Definition at line 37 of file modular_inverse_simple.cpp.