The INT function rounds down a floating point number to the nearest whole number (integer), so that the result of the following two example lines is 3 and -2, respectively:
D> Print Int(3.9999) Print Int(-1.1)
FIX
instruction: fix precision of floating point
Fix(number)
The FIX command changes the way floating point numbers are displayed on screen, or output to a printer. The precision of these floating point numbers is determined by a number (n) that is specified in brackets, and there can be four possibilities, as follows:
Here are some examples:
E> Fix (2) : Print Pi# : Rem Two digits after decimal point Fix(-4) : Print Pi# : Rem Exponential with four digits after decimal point Fix(16) : Print Pi# : Rem Revert to normal mode
Single and double precision
Although the standard floating point system is perfect for general use, it may not be
accurate enough for genuine scientific applications, or advanced simulations. AMOS Professional
offers a choice of two separate calculation systems.
Single Precision
This is the default mode, and is automatically used whenever an AMOS Professional
program is RUN. Single precision is accurate to about seven decimal digits, it is very fast
and it is ideal for the vast majority of applications.
Double precision
Double precision mode offers double the normal degree of accuracy, and is capable of
dealing with extremely precise values. Unlike most pocket calculators, AMOS Professional double
precision can handle numbers with up to 16 significant digits.
This extent of accuracy will consume twice as much memory as the standard version, and it will also cause a great slowing down of calculations. It should only be used when extra accuracy is absolutely vital.