SIMPOL Documentation

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]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 .toval() function. Also, when a number is output to a string, if it contains a repeating decimal then that will be output in the following format: <value>.<non-repeating portion><portion that repeats>[<portion that repeats>] . For example, 3.3333333333333<repeating> would be output as 3.3[3]. The same value can be assigned from a string to a number using .toval().