INT Function

Returns the integer value of a given expression.

Syntax

INT(expression)

Syntax Elements

expression is any valid DataBasic expression or any string, substring, or value; expressed as a variable name, a value, or a string enclosed in quotes.

Operation

INT returns the integer value of expression. The fractional portion of expression is truncated.

If expression is a fraction, INT returns a value of 0.

Examples

I = 5/3
J = INT(I)

Assigns the value 1 to variable J.

PRINT INT(.25)

Prints the value 0, because expression is a fraction.

A = 3.9
B = 3.65
C = INT(A+B)
D = INT(A-B)

Assigns the value 7 to variable C and the value 0 to variable D.

A = INT(-5.7)

Assigns the value -5 to variable A.