up previous next
FloatStr    --    convert rational number to a decimal string


Syntax
FloatStr(X: INT|RAT|RINGELEM): STRING
FloatStr(X: INT|RAT|RINGELEM, Prec: INT): STRING

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

Example
/**/  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

See Also