Leonardus
Loading...
Searching...
No Matches
adapter128.h
Go to the documentation of this file.
1
17#pragma once
18
19// Inc Library
20#include <string>
21#include <gmp.h>
22
23
27std::string to_string( __int128 p_z );
28
32std::string to_string( __float128 p_float, size_t p_precision );
33
38__int128 stoint128( const std::string & p_s );
39
44__float128 stofloat128( const std::string & p_s );
45
48inline __int128 mmod( __int128 p_x, __int128 p_m ) {
49 const __int128 res = p_x % p_m;
50 return res>=0 ? res : res+p_m;
51}
52
54__float128 ceil( __float128 p_r );
55
57__float128 floor( __float128 p_r );
58
60__float128 trunc( __float128 p_r );
61
63__float128 cos( __float128 p_angle );
64
66__float128 sin( __float128 p_angle );
67
70__float128 sqrt( __float128 p_r );
71
73__float128 atan2( __float128 p_num, __float128 p_den );
74
78__float128 pow( __float128 p_base, __float128 p_exp );
79
81__float128 rint( __float128 p_num );
82
85__float128 log( __float128 p_num );
86
89__float128 log10( __float128 p_num );
90
94bool mpz_t_to___int128( __int128 & p_dst, const mpz_t p_src );
95
98void __int128_to_mpz_t( mpz_t p_dst, __int128 p_src );
99
104void __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:114
std::string to_string(__int128 p_z)
We need an adapter function, because __int128 isn't supported by std::to_string().
Definition adapter128.cpp:34
void __int128_to_mpz_t(mpz_t p_dst, __int128 p_src)
Converts an __int128 into a mpz_t.
Definition adapter128.cpp:184
__int128 mmod(__int128 p_x, __int128 p_m)
Mathemtical modulus.
Definition adapter128.h:48
__float128 ceil(__float128 p_r)
__float128 overload of ceil()
Definition adapter128.cpp:82
__float128 cos(__float128 p_angle)
__float128 overload of cos()
Definition adapter128.cpp:102
__float128 sqrt(__float128 p_r)
__float128 overload of sqrt()
Definition adapter128.cpp:107
__float128 sin(__float128 p_angle)
__float128 overload of sin()
Definition adapter128.cpp:97
__float128 log(__float128 p_num)
__float128 overload of log()
Definition adapter128.cpp:132
__int128 stoint128(const std::string &p_s)
We need an adapter function, because __float128 isn't supported by the standard library.
Definition adapter128.cpp:65
__float128 rint(__float128 p_num)
__float128 overload of rint()
Definition adapter128.cpp:127
__float128 floor(__float128 p_r)
__float128 overload of floor()
Definition adapter128.cpp:87
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:218
__float128 stofloat128(const std::string &p_s)
We need an adapter function, because __float128 isn't supported by the standard library.
Definition adapter128.cpp:76
__float128 pow(__float128 p_base, __float128 p_exp)
__float128 overload of pow()
Definition adapter128.cpp:119
bool mpz_t_to___int128(__int128 &p_dst, const mpz_t p_src)
Converts a mpz_t into an __int128.
Definition adapter128.cpp:146
__float128 trunc(__float128 p_r)
__float128 overload of trunc()
Definition adapter128.cpp:92
__float128 log10(__float128 p_num)
__float128 overload of log10()
Definition adapter128.cpp:139