Leonardus
adapter128.h
Go to the documentation of this file.
1
17#pragma once
18
19#include <string>
20#include <gmp.h>
21
22
26std::string to_string( __int128 p_z );
27
31std::string to_string( __float128 p_float, size_t p_precision );
32
37__int128 stoint128( const std::string & p_s );
38
43__float128 stofloat128( const std::string & p_s );
44
47inline __int128 mmod( __int128 p_x, __int128 p_m ) {
48 const __int128 res = p_x % p_m;
49 return res>=0 ? res : res+p_m;
50}
51
53__float128 ceil( __float128 p_r );
54
56__float128 floor( __float128 p_r );
57
59__float128 trunc( __float128 p_r );
60
62__float128 cos( __float128 p_angle );
63
65__float128 sin( __float128 p_angle );
66
69__float128 sqrt( __float128 p_r );
70
72__float128 atan2( __float128 p_num, __float128 p_den );
73
77__float128 pow( __float128 p_base, __float128 p_exp );
78
80__float128 rint( __float128 p_num );
81
84__float128 log( __float128 p_num );
85
88__float128 log10( __float128 p_num );
89
93bool mpz_t_to___int128( __int128 & p_dst, const mpz_t p_src );
94
97void __int128_to_mpz_t( mpz_t p_dst, __int128 p_src );
98
103void __float128_to_mpf_t( mpf_t p_dst, __float128 p_f128 );
__float128 atan2(__float128 p_num, __float128 p_den)
__float128 overload of atan2()
Definition: adapter128.cpp:113
std::string to_string(__int128 p_z)
We need an adapter function, because __int128 isn't supported by std::to_string().
Definition: adapter128.cpp:33
void __int128_to_mpz_t(mpz_t p_dst, __int128 p_src)
Converts an __int128 into a mpz_t.
Definition: adapter128.cpp:183
__int128 mmod(__int128 p_x, __int128 p_m)
Mathemtical modulus.
Definition: adapter128.h:47
__float128 ceil(__float128 p_r)
__float128 overload of ceil()
Definition: adapter128.cpp:81
__float128 cos(__float128 p_angle)
__float128 overload of cos()
Definition: adapter128.cpp:101
__float128 sqrt(__float128 p_r)
__float128 overload of sqrt()
Definition: adapter128.cpp:106
__float128 sin(__float128 p_angle)
__float128 overload of sin()
Definition: adapter128.cpp:96
__float128 log(__float128 p_num)
__float128 overload of log()
Definition: adapter128.cpp:131
__int128 stoint128(const std::string &p_s)
We need an adapter function, because __float128 isn't supported by the standard library.
Definition: adapter128.cpp:64
__float128 rint(__float128 p_num)
__float128 overload of rint()
Definition: adapter128.cpp:126
__float128 floor(__float128 p_r)
__float128 overload of floor()
Definition: adapter128.cpp:86
void __float128_to_mpf_t(mpf_t p_dst, __float128 p_f128)
Converts a __float128 to a mpf_t, since GMP doesn't support 128 Bit floats directly.
Definition: adapter128.cpp:217
__float128 stofloat128(const std::string &p_s)
We need an adapter function, because __float128 isn't supported by the standard library.
Definition: adapter128.cpp:75
__float128 pow(__float128 p_base, __float128 p_exp)
__float128 overload of pow()
Definition: adapter128.cpp:118
bool mpz_t_to___int128(__int128 &p_dst, const mpz_t p_src)
Converts a mpz_t into an __int128.
Definition: adapter128.cpp:145
__float128 trunc(__float128 p_r)
__float128 overload of trunc()
Definition: adapter128.cpp:91
__float128 log10(__float128 p_num)
__float128 overload of log10()
Definition: adapter128.cpp:138