Leonardus
Typedefs | Enumerations | Functions | Variables
helper.h File Reference

Miscellaneous definitions and functions. More...

#include <cstdint>
#include <limits>
#include <climits>
#include <gmp.h>
+ Include dependency graph for helper.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

using core_t = void(Context &)
 A shortcut for the core code functions, the C++ implementations of the operators.
 

Enumerations

enum class  AngularUnit : std::uint8_t { DEG , RAD }
 Angular Unit for trigonometric functions.
 

Functions

void helper_init ()
 Initializes MPZ_ global pseudo-constants. More...
 
void helper_clear ()
 Clears MPZ_ global pseudo-constants.
 

Variables

constexpr __float128 M_PI_180q = 0.017453292519943295769236907684886127134Q
 pi/180.
 
constexpr __float128 M_180_PIq = 57.295779513082320876798154814105170332405Q
 180/pi.
 
constexpr __float128 M_2PIq = 6.283185307179586476925286766559005768394Q
 2pi.
 
constexpr unsigned __int128 UINT128_MAX = std::numeric_limits<unsigned __int128>::max()
 Maximum unsigned int128.
 
constexpr __int128 INT128_MIN = std::numeric_limits<__int128>::min()
 Minimum int128.
 
constexpr __int128 INT128_MAX = std::numeric_limits<__int128>::max()
 Maximum int128.
 
constexpr size_t ULBITS = sizeof( unsigned long ) * CHAR_BIT
 Number of bits in an unsigned long.
 
constexpr size_t ULCHUNKS = 128 / ULBITS
 Number of unsigned longs fitting into an UINT128.
 
mpz_t MPZ_ZERO
 mpz_t 0 initialized by helper_init().
 
mpz_t MPZ_ONE
 mpz_t 1 initialized by helper_init().
 
mpz_t MPZ_INT128_MIN
 mpz_t -2^127 initialized by helper_init().
 
mpz_t MPZ_INT128_MAX
 mpz_t 2^127-1 initialized by helper_init().
 
constexpr size_t maxrealprecision = 34
 Valid decimal digits of a 113 bit mantissa of a 128 bit floating point number. More...
 
constexpr size_t maxarraynesting = 1000
 The maximum number of nesting levels of procedures accepted by the bind operator.
 
constexpr size_t maxtreeheight = 1999
 The maximum number of nesting levels of composite semantic objects.
 

Detailed Description

Miscellaneous definitions and functions.

Function Documentation

◆ helper_init()

void helper_init ( )

Initializes MPZ_ global pseudo-constants.

Since GMP has no static initialization, we use this style of initialization.

Variable Documentation

◆ maxrealprecision

constexpr size_t maxrealprecision = 34
constexpr

Valid decimal digits of a 113 bit mantissa of a 128 bit floating point number.

It's the $ \lfloor log_{10}(2^{113})\rfloor $.