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 int128_to_string( __int128 p_z );
28
32std::string float128_to_string( __float128 p_float, size_t p_precision );
33
38__int128 string_to_int128( const std::string & p_s );
39
44__float128 string_to_float128( const std::string & p_s );
45
49bool mpz_t_to___int128( __int128 & p_dst, const mpz_t p_src );
50
53void __int128_to_mpz_t( mpz_t p_dst, __int128 p_src );
54
59void __float128_to_mpf_t( mpf_t p_dst, __float128 p_f128 );
60
61
64namespace adapter128 {
65
67__float128 ceil( __float128 p_r );
68
70__float128 floor( __float128 p_r );
71
73__float128 trunc( __float128 p_r );
74
76__float128 cos( __float128 p_angle );
77
79__float128 sin( __float128 p_angle );
80
83__float128 sqrt( __float128 p_r );
84
86__float128 atan2( __float128 p_num, __float128 p_den );
87
89__float128 asin( __float128 p_ratio );
90
92__float128 acos( __float128 p_ratio );
93
97__float128 pow( __float128 p_base, __float128 p_exp );
98
100__float128 rint( __float128 p_num );
101
104__float128 log( __float128 p_num );
105
108__float128 log10( __float128 p_num );
109
110} // namespace adapter128
void __int128_to_mpz_t(mpz_t p_dst, __int128 p_src)
Converts an __int128 into a mpz_t.
Definition adapter128.cpp:120
std::string float128_to_string(__float128 p_float, size_t p_precision)
We need an adapter function, because __float128 isn't supported by std::to_string().
Definition adapter128.cpp:56
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:154
__int128 string_to_int128(const std::string &p_s)
We need an adapter function, because __int128 isn't supported by the standard library.
Definition adapter128.cpp:65
std::string int128_to_string(__int128 p_z)
We need an adapter function, because __int128 isn't supported by std::to_string().
Definition adapter128.cpp:34
bool mpz_t_to___int128(__int128 &p_dst, const mpz_t p_src)
Converts a mpz_t into an __int128.
Definition adapter128.cpp:82
__float128 string_to_float128(const std::string &p_s)
We need an adapter function, because __float128 isn't supported by the standard library.
Definition adapter128.cpp:76
Collection of adapters for 128 bit data types.
Definition adapter128.h:64
__float128 floor(__float128 p_r)
__float128 overload of floor()
Definition adapter128.cpp:171
__float128 rint(__float128 p_num)
__float128 overload of rint()
Definition adapter128.cpp:221
__float128 atan2(__float128 p_num, __float128 p_den)
__float128 overload of atan2()
Definition adapter128.cpp:198
__float128 ceil(__float128 p_r)
__float128 overload of ceil()
Definition adapter128.cpp:166
__float128 log10(__float128 p_num)
__float128 overload of log10()
Definition adapter128.cpp:233
__float128 asin(__float128 p_ratio)
__float128 overload of asin()
Definition adapter128.cpp:203
__float128 cos(__float128 p_angle)
__float128 overload of cos()
Definition adapter128.cpp:186
__float128 log(__float128 p_num)
__float128 overload of log()
Definition adapter128.cpp:226
__float128 pow(__float128 p_base, __float128 p_exp)
__float128 overload of pow()
Definition adapter128.cpp:213
__float128 trunc(__float128 p_r)
__float128 overload of trunc()
Definition adapter128.cpp:176
__float128 sin(__float128 p_angle)
__float128 overload of sin()
Definition adapter128.cpp:181
__float128 sqrt(__float128 p_r)
__float128 overload of sqrt()
Definition adapter128.cpp:191
__float128 acos(__float128 p_ratio)
__float128 overload of acos()
Definition adapter128.cpp:208