PRINT Precision in Advanced Revelation 2.0
Published By | Date | Version | Knowledge Level | Keywords |
---|---|---|---|---|
Revelation Technologies | 10 OCT 1990 | 2.X | NOVICE | PRINT, OCONV |
Advanced Revelation for DOS supports floating point numbers with up to 18 decimal digits (18 digits after the decimal). Version 2.0 was enhanced to give you more control in displaying floating point numbers using the PRINT command. This technical bulletin explains the differences in the PRINT command between version 1.X and 2.0.
Version 1.X
Prior to version 2.0, the PRINT command displayed only four places to the right of the decimal. This statement:
PRINT 1/3
would display: .3333 under all circumstances. There were no options.
Version 2.0
With version 2.0, you decide how many decimal digits to display by including an OCONV with a PRINT command. Unless you specify an OCONV, PRINT displays up to the full 18 decimal digits. This statement:
PRINT 1/3
now displays: .333333333333333333
To limit display to 4 digits, use the following statement:
PRINT OCONV(1/3, "MD40")
which displays: .3333
Indicate one to nine decimal digits using MD1 to MD9, and ten to 18 decimal digits using A to I:
Conversion | Decimal digits |
---|---|
MDA | 10 |
MDB | 11 |
MDC | 12 |
MDD | 13 |
MDE | 14 |
MDF | 15 |
MDG | 16 |
MDH | 17 |
MDI | 18 |
MD0 gives you neither decimal digits nor a decimal.