Leonardus
algo.h
Go to the documentation of this file.
1
17#pragma once
18
19#include <string>
20#include <cstdint>
21#include <gmp.h>
22
23
26namespace algo {
27
38 __int128 xgcd( __int128 p_a, __int128 p_b, __int128 & p_s, __int128 & p_t );
39
44 bool isint128( std::string p_str );
45
50 bool isint128( const mpz_t p_x );
51
56 int32_t rand( uint32_t * seed );
57
58} // namespace algo
Collection of numeric algorithms.
Definition: algo.h:26
__int128 xgcd(__int128 p_a, __int128 p_b, __int128 &p_s, __int128 &p_t)
Extended Euclidean algorithm.
Definition: algo.cpp:27
bool isint128(std::string p_str)
Is the string a 128 bit integer.
Definition: algo.cpp:62
int32_t rand(uint32_t *seed)
ISO C rand_r() for 32 bit.
Definition: algo.cpp:123