PRECISION


The PRECISION statement informs jBASE as to the number of digits of precision it uses after the decimal point in numbers.

 

COMMAND SYNTAX

PRECISION integer

 

SYNTAX ELEMENTS

integer should be in the range 0 to 9.

 

NOTES

If the program contains no PRECISION statement then is it is set with a default precision of 4.

If there is one (or more) PRECISION statements then the first one encountered is taken as the PRECISION of the program. During the runtime of the program the precision will changed as it encounters any subsequent PRECISION statements.

A PRECISION statement can be specified any number of times in a source file. Only the most recently defined precision will be active at any one time.

Calling programs and external subroutines do not have to be compiled at the same degree of precision, however, any changes to precision in a subroutine will not persist when control returns to the calling program.

jBASE uses the maximum degree of precision allowed on the host machine in all mathematical calculations to ensure maximum accuracy. It then uses the defined precision to format the number.

 

EXAMPLES

PRECISION 6
CRT 2/3

will print the value 0.666666 (note truncation not rounding!).


jBC