[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
5.11 Rounding Mode Related Functions
- Function: void mpfr_set_default_rounding_mode (mp_rnd_t rnd)
Set the default rounding mode to rnd. The default rounding mode is to nearest initially.
- Function: int mpfr_prec_round (mpfr_t x, mp_prec_t prec, mp_rnd_t rnd)
Round x according to rnd with precision prec, which must be an integer between
MPFR_PREC_MIN
andMPFR_PREC_MAX
(otherwise the behavior is undefined). If prec is greater or equal to the precision of x, then new space is allocated for the significand, and it is filled with zeros. Otherwise, the significand is rounded to precision prec with the given direction. In both cases, the precision of x is changed to prec.
- Function: int mpfr_round_prec (mpfr_t x, mp_rnd_t rnd, mp_prec_t prec)
[This function is obsolete. Please use
mpfr_prec_round
instead.]
- Function: const char * mpfr_print_rnd_mode (mp_rnd_t rnd)
Return the input string (GMP_RNDD, GMP_RNDU, GMP_RNDN, GMP_RNDZ) corresponding to the rounding mode rnd or a null pointer if rnd is an invalid rounding mode.