manpagez: man pages & more
info mpfr
Home | html | info | man
[ < ] [ > ]   [ << ] [ 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: mp_rnd_t mpfr_get_default_rounding_mode (void)

Get the default rounding mode.

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 and MPFR_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.


© manpagez.com 2000-2025
Individual documents may contain additional copyright information.