Arbitrary Precision Computation

If a number has the suffix M it is treated as an arbitrary precision floating point number, which by default has about 38 significant decimal digits. For example
>> sqrt(3M)
   1.73205080756887729352744634150587E0
>> x = 3.14159265358979323846264338327950M
     3.14159265358979323846264338327950E0
>> sqrt(x)
     1.77245385090551602729816748334114E0
The precision of MPF can be rest by assigning a multiple to global variable global.mpf_ndigits.

The default value of mpf_ndigits is 128, therefore an mpf may have 128 significant binary digits as opposed to 52 for double. The value of mpf_ndigits. can be set to a multiple (at least 2) of 32.

If a number has the suffix L it is treated as a long integer, which can be as big as the computer memory allows. For example

>> 128L ^ 20L
     1393796574908163946345982392040522594123776



oz 2009-12-22