Leonardus
|
Implementation of adapters for 128 bit versions of standard functions. More...
#include <string>
#include <charconv>
#include <cstdlib>
#include <quadmath.h>
#include <gmp.h>
#include "algo.h"
#include "dbc.h"
#include "helper.h"
#include "adapter128.h"
#include "error.h"
Functions | |
string | to_string (const __int128 p_z) |
We need an adapter function, because __int128 isn't supported by std::to_string(). More... | |
string | to_string (__float128 p_float, size_t p_precision) |
We need an adapter function, because __float128 isn't supported by std::to_string(). More... | |
__int128 | stoint128 (const string &p_s) |
We need an adapter function, because __float128 isn't supported by the standard library. More... | |
__float128 | stofloat128 (const string &p_s) |
We need an adapter function, because __float128 isn't supported by the standard library. More... | |
__float128 | ceil (__float128 p_r) |
__float128 overload of ceil() | |
__float128 | floor (__float128 p_r) |
__float128 overload of floor() | |
__float128 | trunc (__float128 p_r) |
__float128 overload of trunc() | |
__float128 | sin (__float128 p_angle) |
__float128 overload of sin() | |
__float128 | cos (__float128 p_angle) |
__float128 overload of cos() | |
__float128 | sqrt (__float128 p_r) |
__float128 overload of sqrt() More... | |
__float128 | atan2 (__float128 p_num, __float128 p_den) |
__float128 overload of atan2() | |
__float128 | pow (__float128 p_base, __float128 p_exp) |
__float128 overload of pow() More... | |
__float128 | rint (__float128 p_num) |
__float128 overload of rint() | |
__float128 | log (__float128 p_num) |
__float128 overload of log() More... | |
__float128 | log10 (__float128 p_num) |
__float128 overload of log10() More... | |
bool | mpz_t_to___int128 (__int128 &p_dst, const mpz_t p_src) |
Converts a mpz_t into an __int128. More... | |
void | __int128_to_mpz_t (mpz_t p_dst, __int128 p_src) |
Converts an __int128 into a mpz_t. | |
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. More... | |
Implementation of adapters for 128 bit versions of standard functions.
Leonardus, a minimalist stack-based programming system. Copyright (C) 2025 Andreas Muckenschnabel This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
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.
[out] | p_dst | ... destination mpf_t |
[in] | p_f128 | ... source __float128 |
__float128 log | ( | __float128 | p_num | ) |
__float128 overload of log()
__float128 log10 | ( | __float128 | p_num | ) |
__float128 overload of log10()
bool mpz_t_to___int128 | ( | __int128 & | p_dst, |
const mpz_t | p_src | ||
) |
Converts a mpz_t into an __int128.
__float128 pow | ( | __float128 | p_base, |
__float128 | p_exp | ||
) |
__float128 overload of pow()
__float128 sqrt | ( | __float128 | p_r | ) |
__float128 overload of sqrt()
__float128 stofloat128 | ( | const std::string & | p_s | ) |
We need an adapter function, because __float128 isn't supported by the standard library.
Implemented with GNU quadmath.
[in] | p_s | contains a string representation as described in the POSIX strtof() function. |
__int128 stoint128 | ( | const std::string & | p_s | ) |
We need an adapter function, because __float128 isn't supported by the standard library.
string to_string | ( | __float128 | p_float, |
size_t | p_precision | ||
) |
We need an adapter function, because __float128 isn't supported by std::to_string().
Implementation with GNU quadmath.
string to_string | ( | __int128 | p_z | ) |
We need an adapter function, because __int128 isn't supported by std::to_string().
[in] | p_z | we need a representation for this integer |