Directives
ROUND Control Rounding
   
Format ROUND {ON | OFF}
   
Description Use the ROUND directive to control the automatic rounding of values during calculations. If you use the ROUND ON directive, ProvideX will round all values to the PRECISION currently in effect before assigning them to numeric variables. The ROUND OFF directive terminates the rounding process. With ROUND OFF, ProvideX maintains all values at full 14-digit precision.

The ROUND directive has no effect if FLOATINGPOINT mode is active.

Rounding Control

The unpredicable rounding of numeric values can cause problems during execution. It is very important to know how rounding works in ProvideX. If rounding is set to the default, a divide operation in ProvideX will maintain the precision of the starting value; e.g., 1014.475/100 becomes 10.14475 which gets rounded to 10.145. The automatic rounding of intermediate results can be turned off by setting the 'NR' System Parameter,. Various other types of rounding can be controlled using the 'RN'= System Parameter

   
See Also PRECISION Change Current Precision,
FLOATINGPOINT Switch to Scientific Notation
   
Examples With ROUND OFF

0010 PRECISION 2
0020 ROUND OFF
0030 LET A=3*(2/3)
0040 PRINT A
-:run
2

With ROUND ON:

0010 PRECISION 2
0020 ROUND ON
0030 LET A=3*(2/3)
0040 PRINT A
-:run
2.01