Next: Memory Handling, Previous: Floating-Point Values on Special Numbers, Up: MPFR Basics [Index]
MPFR supports 6 exception types:
Note: This is not the single possible definition of the underflow. MPFR chooses to consider the underflow after rounding. The underflow before rounding can also be defined. For instance, consider a function that has the exact result 7 multiplied by two to the power e−4, where e is the smallest exponent (for a significand between 1/2 and 1), with a 2-bit target precision and rounding toward plus infinity. The exact result has the exponent e−1. With the underflow before rounding, such a function call would yield an underflow, as e−1 is outside the current exponent range. However, MPFR first considers the rounded result assuming an unbounded exponent range. The exact result cannot be represented exactly in precision 2, and here, it is rounded to 0.5 times 2 to e, which is representable in the current exponent range. As a consequence, this will not yield an underflow in MPFR.
mpfr_cmp
, or a
conversion to an integer cannot be represented in the target type).
MPFR has a global flag for each exception, which can be cleared, set or tested by functions described in Exception Related Functions.
Differences with the ISO C99 standard:
Next: Memory Handling, Previous: Floating-Point Values on Special Numbers, Up: MPFR Basics [Index]