bas7ex.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
CDBL Function Programming Example
                       Example                 Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
'This example demonstrates how using the CDBL function affects precision.
 
X = 7/9
X# = 7/9
PRINT X
'Both X# and CDBL(X) will be accurate to only 7 decimal
'places, because 7/9 is evaluated in single precision.
PRINT X#
PRINT CDBL(X)
'Accurate to 15 decimal places.
PRINT 7#/9#
 
'Sample Output
'
' .7777778
' .7777777910232544
' .7777777910232544
' .7777777777777778