Leonardus
Loading...
Searching...
No Matches
helper.h
Go to the documentation of this file.
1
17#pragma once
18
19// Inc Library
20#include <cstdint>
21#include <limits>
22#include <climits>
23#include <gmp.h>
24
25
27constexpr __float128 M_PI_180q = 0.017453292519943295769236907684886127134Q;
28
30constexpr __float128 M_180_PIq = 57.295779513082320876798154814105170332405Q;
31
33constexpr __float128 M_2PIq = 6.283185307179586476925286766559005768394Q;
34
36constexpr unsigned __int128 UINT128_MAX = std::numeric_limits<unsigned __int128>::max();
37
39constexpr __int128 INT128_MIN = std::numeric_limits<__int128>::min();
40
42constexpr __int128 INT128_MAX = std::numeric_limits<__int128>::max();
43
45constexpr size_t ULBITS = sizeof( unsigned long ) * CHAR_BIT;
46
48constexpr size_t ULCHUNKS = 128 / ULBITS;
49
51extern mpz_t MPZ_ZERO;
52
54extern mpz_t MPZ_ONE;
55
57extern mpz_t MPZ_INT128_MIN;
58
60extern mpz_t MPZ_INT128_MAX;
61
65void helper_init();
66
68void helper_clear();
69
72constexpr size_t maxrealprecision = 34;
73
75constexpr size_t maxarraynesting = 1000;
76
78constexpr size_t maxtreeheight = 1999;
79
81enum class AngularUnit : std::uint8_t {
82 DEG,
83 RAD
84};
85
86class Context;
87
89 using core_t = void( Context & );
The context of execution.
Definition context.h:42
constexpr unsigned __int128 UINT128_MAX
Maximum unsigned int128.
Definition helper.h:36
void helper_init()
Initializes MPZ_ global pseudo-constants.
Definition helper.cpp:30
constexpr __int128 INT128_MIN
Minimum int128.
Definition helper.h:39
void helper_clear()
Clears MPZ_ global pseudo-constants.
Definition helper.cpp:43
constexpr size_t maxrealprecision
Valid decimal digits of a 113 bit mantissa of a 128 bit floating point number.
Definition helper.h:72
mpz_t MPZ_INT128_MAX
mpz_t 2^127-1 initialized by helper_init().
Definition helper.cpp:27
mpz_t MPZ_ONE
mpz_t 1 initialized by helper_init().
Definition helper.cpp:25
AngularUnit
Angular Unit for trigonometric functions.
Definition helper.h:81
constexpr __int128 INT128_MAX
Maximum int128.
Definition helper.h:42
mpz_t MPZ_ZERO
mpz_t 0 initialized by helper_init().
Definition helper.cpp:24
constexpr size_t ULCHUNKS
Number of unsigned longs fitting into an UINT128.
Definition helper.h:48
void(Context &) core_t
A shortcut for the core code functions, the C++ implementations of the operators.
Definition helper.h:89
constexpr size_t ULBITS
Number of bits in an unsigned long.
Definition helper.h:45
constexpr __float128 M_180_PIq
180/pi.
Definition helper.h:30
constexpr __float128 M_2PIq
2pi.
Definition helper.h:33
constexpr size_t maxarraynesting
The maximum number of nesting levels of procedures accepted by the bind operator.
Definition helper.h:75
constexpr size_t maxtreeheight
The maximum number of nesting levels of composite semantic objects.
Definition helper.h:78
constexpr __float128 M_PI_180q
pi/180.
Definition helper.h:27
mpz_t MPZ_INT128_MIN
mpz_t -2^127 initialized by helper_init().
Definition helper.cpp:26
@ Q
SOQ.