Next: , Previous: mpfr unary operators, Up: mpfr


D.14.3 mpfr binary operators with a natural operand

Functions with these names take an argument of the form (x,n), where x is an mpfr number and n is a natural number.

The last two are specific to the virtual code interface, having no counterpart in the native API of the mpfr library. The grow function returns a copy of x with its precision increased by n bits, and the shrink function returns a copy of x with its precision reduced by n bits.

The appropriate way to use grow is to grow the precision of an operand before applying an operator to it, which will cause the result to be computed to the full precision. This capability is suitable for algorithms that iterate over increasing precisions until a stopping criterion is met.