Conversion Functions
You can use conversion (see
Jenks section 9.27.2)
to go back and forth between
Integer,
Fraction(Integer) and
Float, as appropriate.
Since you are explicitly asking for a conversion, you must take
responsibility for any loss of exactness.
This conversion cannot be performed: use
truncate or
round if that is what you intend.
The operations
truncate and
round truncate ...
and round to the nearest integral Float
respectively.
The operation fractionPart
computes the fractional part of x, that is, x-truncate x.
The operation digits allows the user to
set the precision. It returns the previous value it was using.
The precision is only limited by the computer memory available.
Calculations at 500 or more digits of precision are not difficult.
Reset digits to its default value.
Numbers of type Float are represented as a record
of two integers, namely, the mantissa and the exponent where the base
of the exponent is binary. That is, the floating point number of the
binary. That is, the floating point number (m,e) represents the number
m*2**e. A consequence of using a binary base is that decimal numbers
can not, in general, be represented exactly.