
INT( )
Description
This function is used to truncate a floating point number.
Syntax
INT (n)
Parameter
Description
n
n can be positive or negative integer, floating
point number or mathematical expression.
Example
DOWNLOAD "DEMO.BAS"
SIZE 3,2
GAP 0,0
DENSITY 8
SPEED 3
DIRECTION 0
REFERENCE 0,0
SET PEEL OFF
CLS
REM **** To round up or down****
INPUT "Number:",Num
N=INT(Num+0.5)
IF N>Num THEN
TEXT 50,100,"3",0,1,1,"To round up= "+STR$(N)
ELSE
TEXT 50,100,"3",0,1,1,"To round down= "+STR$(N)
ENDIF
PRINT 1
EOP
See Also
DOWNLOAD, EOP, END, ABS(), ASC(), STR$()