ex.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.
Ctype Functions Example
                        Example                Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
' This example use the CSNG and CDBL functions to demonstrate how floating-
' point precision can be lost when a double-precision number is converted
' to single precision.
 
' To try this example:
' 1. Choose New Project from the file menu
' 2. Copy the code example below to the code window
' 3. Press F5 to run the example
 
 CLS                                 ' Clear the screen
 d# = 7# / 9#
 PRINT "d# originally = "; TAB(40); d#
 s! = CSNG(d#)                       ' Convert double (d#) to single (s!)
 PRINT "s! assigned value from d#, now = "; TAB(40); s!
 d# = CDBL(s!)                       ' Convert single (s!) back to double (d#)
 PRINT "d# assigned value back from s!, now = "; TAB(40); d#