qb45advr.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.
INT Function Programming Example
  QuickSCREEN      Details     Example      Contents      Index
──────────────────────────────────────────────────────────────────────────────
INT Function Programming Example
 
This example compares output from INT, CINT, and FIX, the three
functions that convert numeric data to integers.
 
CLS                ' Clear screen
PRINT "  N","INT(N)","CINT(N)","FIX(N)" : PRINT
FOR I% = 1 TO 6
    READ N
    PRINT N, INT(N), CINT(N), FIX(N)
NEXT
DATA  99.3, 99.5, 99.7, -99.3, -99.5, -99.7
 
 
Sample Output
 
  N           INT(N)        CINT(N)       FIX(N)
 
 99.3          99            99            99
 99.5          99            100           99
 99.7          99            100           99
-99.3         -100          -99           -99
-99.5         -100          -100          -99
-99.7         -100          -100          -99