Int


Function Int( numeric expression )


Returns the largest integer less than or equal to numeric expression.


Syntax a = Int( b )


Remarks

Int will round down in all cases.


See Also:

Math Functions


Example Script


NUMBER i


FOR i = 1 TO 2 STEP 0.05 ' Twenty steps

PRINT "I is going to round from "; i; " to ";

PRINT INT(i)

NEXT


Script Output


I is going to round from 1 to 1

I is going to round from 1.05 to 1

I is going to round from 1.1 to 1

I is going to round from 1.15 to 1

I is going to round from 1.2 to 1

I is going to round from 1.25 to 1

I is going to round from 1.3 to 1

I is going to round from 1.35 to 1

I is going to round from 1.4 to 1

I is going to round from 1.45 to 1

I is going to round from 1.5 to 1

I is going to round from 1.55 to 1

I is going to round from 1.6 to 1

I is going to round from 1.65 to 1

I is going to round from 1.7 to 1

I is going to round from 1.75 to 1

I is going to round from 1.8 to 1

I is going to round from 1.85 to 1

I is going to round from 1.9 to 1

I is going to round from 1.95 to 1

I is going to round from 2 to 2