[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### 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.

- `root`
- `pow_ui`
- `mul_2ui`
- `div_2ui`
- `grow`
- `shrink`

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 precisions are silently capped at the maximum or floored at the minimum allowable precisions if necessary.
- Increasing the precision by the `grow` function does not directly cause a more accurate result to be computed, but only pads an existing number with zeros.
- Decreasing the precision by the `shrink` function does not prevent valid bits from being discarded.

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.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

This document was generated on November 8, 2012 using texi2html 1.82.