ex.hlp (Topic list)
FIX, and INT Functions Example
                        Example                Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
' This example compares output from INT, CINT, and FIX:
' • INT rounds down for positive numbers, up for negative numbers
' • FIX always rounds down (towards 0)
' • CINT rounds off (at .5, CINT rounds towards the nearest even integer)
 
' To try this example:
' 1. Choose New Project from the File menu
' 2. Copy the example code below to the code window
' 3. Press F5 to run the example
 
 CLS                               ' Clear the screen
 PRINT " N", "INT(N)", "FIX(N)", "CINT(N)"
 N! = 99.3
 FOR count% = 1 TO 3
     PRINT N!, INT(N!), FIX(N!), CINT(N!)
     N! = N! + .2
 NEXT
 PRINT
 N! = -99.7
 FOR count% = 1 TO 3
     PRINT N!, INT(N!), FIX(N!), CINT(N!)
     N! = N! + .2
 NEXT