📜  mpfr_set_precision - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:35.008000             🧑  作者: Mango

代码示例1
Function: void mpfr_set_prec (mpfr_t x, mpfr_prec_t prec)

    Set the precision of x to be exactly prec bits, and set its value to NaN. The previous value stored in x is lost. It is equivalent to a call to mpfr_clear(x) followed by a call to mpfr_init2(x, prec), but more efficient as no allocation is done in case the current allocated space for the significand of x is enough. The precision prec can be any integer between MPFR_PREC_MIN and MPFR_PREC_MAX. In case you want to keep the previous value stored in x, use mpfr_prec_round instead.

    Warning! You must not use this function if x was initialized with MPFR_DECL_INIT or with mpfr_custom_init_set (see Custom Interface).