///// Integer rounding functions that return ExactFloat values. Round up to the nearest integer.
Return an ExactFloat with the magnitude of "a" and the sign bit of "b". (Note that an IEEE zero can be either positive or negative.)
A synonym for remainder().
/////////////////////////////////////////////////////////////////// ///// Miscellaneous simple arithmetic functions. Absolute value.
Positive difference: max(a - b, 0).
Round down to the nearest integer.
Maximum of two values.
Minimum of two values.
///// Remainder functions. The remainder of dividing "a" by "b", where the quotient is rounded toward zero to the nearest integer. Similar to (a - trunc(a / b) * b).
Convert "a" to a normalized fraction in the range \[0.5, 1\) times a power of two. Return the fraction and set "exp" to the exponent. If "a" is zero, infinity, or NaN then return "a" and set "exp" to zero.
Convert "a" to a normalized fraction in the range \[1,2\) times a power of two, and return the exponent value as an integer. This is equivalent to lrint(floor(log2(fabs(a)))) but it is computed more efficiently. Returns the constants documented in the man page for zero, infinity, or NaN.
Return "a" multiplied by 2 raised to the power "exp".
Convert "a" to a normalized fraction in the range \[1,2\) times a power of two, and return the exponent value as an ExactFloat. This is equivalent to floor(log2(fabs(a))) but it is computed more efficiently.
///// Integer rounding functions that return C++ integer types. Like rint(), but rounds to the nearest "long" value. Returns the minimum/maximum possible integer if the value is out of range.
Like round(), but rounds to the nearest "long" value. Returns the minimum/maximum possible integer if the value is out of range.
Break the argument "a" into integer and fractional parts, each of which has the same sign as "a". The fractional part is returned, and the integer part is stored in the output parameter "i_ptr". Both output values are set to have the same maximum precision as "a".
A synonym for rint().
The remainder of dividing "a" by "b", where the quotient is rounded to the nearest integer, rounding halfway cases to an even integer. Similar to (a - rint(a / b) * b).
Round to the nearest integer, rounding halfway cases to an even integer. For example: f(-0.5) = 0, f(0.5) = 0, f(1.5) = 2, f(2.5) = 2.
Round to the nearest integer, rounding halfway cases away from zero. For example: f(-0.5) = -1, f(0.5) = 1, f(1.5) = 2, f(2.5) = 3.
A version of ldexp() where "exp" is a long integer.
A synonym for ldexp().
Round to the nearest integer not larger in absolute value. For example: f(-1.9) = -1, f(2.9) = 2.
ExactFloat is a multiple-precision floating point type based on the OpenSSL Bignum library. It has the same interface as the built-in "float" and "double" types, but only supports the subset of operators and intrinsics where it is possible to compute the result exactly. So for example, ExactFloat supports addition and multiplication but not division (since in general, the quotient of two floating-point numbers cannot be represented exactly). Exact arithmetic is useful for geometric algorithms, especially for disambiguating cases where ordinary double-precision arithmetic yields an uncertain result.