Previous: Custom Interface, Up: MPFR Interface


5.16 Internals

The following types and functions were mainly designed for the implementation of mpfr, but may be useful for users too. However no upward compatibility is guaranteed. You may need to include mpfr-impl.h to use them.

The mpfr_t type consists of four fields.

— Function: int mpfr_can_round (mpfr_t b, mp_exp_t err, mp_rnd_t rnd1, mp_rnd_t rnd2, mp_prec_t prec)

Assuming b is an approximation of an unknown number x in the direction rnd1 with error at most two to the power E(b)-err where E(b) is the exponent of b, return a non-zero value if one is able to round correctly x to precision prec with the direction rnd2, and 0 otherwise (including for NaN and Inf). This function does not modify its arguments.

— Function: double mpfr_get_d1 (mpfr_t op)

Convert op to a double, using the default MPFR rounding mode (see function mpfr_set_default_rounding_mode). This function is obsolete.