Function: mpfr_to_string_d (R, FORMAT, X)

Convert binary64 numbers X to string representation, either exact or correctly rounded.

The result is a cell array of strings and, if not exact, is rounded in the direction R (0: towards zero, 0.5: towards nearest and ties to even, +inf: towards positive infinity, -inf: towards negative infinity).

The FORMAT may be one of the following:

auto

Varying mantissa length with 5 or 15 places, depending on the currently active format. It is also possible to define other values with the output_precision function.

decimal

Varying mantissa length with up to 16 or 17 places. This format will correctly separate subsequent numbers of binary64 precision with the least possible number of digits.

exact decimal

Varying mantissa length with up to 751 places.

exact hexadecimal

Fixed mantissa length with 1+13 hexadecimal places. The digit before the point is only zero if the number is denormalized. For normalized numbers the digit before the point should be 1, but this is not guaranteed and depends on the C compiler used.

mpfr_to_string_d (-inf, "exact hexadecimal", magic (3) / 10)
 ⇒
   {
     [1,1] = 0x1.999999999999ap-1
     [2,1] = 0x1.3333333333333p-2
     [3,1] = 0x1.999999999999ap-2
     [1,2] = 0x1.999999999999ap-4
     [2,2] = 0x1.0000000000000p-1
     [3,2] = 0x1.ccccccccccccdp-1
     [1,3] = 0x1.3333333333333p-1
     [2,3] = 0x1.6666666666666p-1
     [3,3] = 0x1.999999999999ap-3
   }

Package: interval