Numbers
The number data type in SIMPOL does not make use of
floating point and is therefore not affected by the typical rounding errors
that are found in floating point. The values stored in objects of type
number are completely precise. Repeating decimal values
are stored internally with complete accuracy. They can also be output in such
a way as to indicate that they are repeating values and they can be converted
back from strings to numbers with no loss of accuracy. An important point to
remember when working with numbers in SIMPOL is that if you don't want
values to have hundreds or even thousands of significant digits after the
decimal point, then it is imperative that you make use of the
.fix()
intrinsic function to reduce the value to the
precision and scale desired.
Note | |
---|---|
Currently it is not possible to assign a decimal value to a number in
the source code. To assign a decimal value, use a string and the
|