up previous next
FloatStr --
convert rational number to a decimal string
|
FloatStr(X: INT|RAT|RINGELEM): STRING
FloatStr(X: INT|RAT|RINGELEM, Prec: INT): STRING |
This function produces a decimal string representation of the rational
number
X. The optional second argument
Prec says how many
significant decimal digits to produce; the default number of digits is 5.
The aim is to produce an easily readable result.
/**/ FloatStr(2/3); -- last printed digit is rounded
0.66667
/**/ FloatStr(7^510); -- no arbitrary limit on exponent range
1.0000*10^431
/**/ FloatStr(1/81, 35); -- specify number of digits
0.012345679012345679012345679012345679
|