Home > lang > int 
 fr de es it nl pl pt pt_BR mk sq ca ar fa vi ja ru zh zh_TW eo
Previous  Next  Edit  Rename  Undo  Refresh  Search  Administration  
Documentation
History
 
Int
Syntax
Value = Int ( Number )

Returns the mathematical integer part of Number, i.e. the greatest integer which is less than Number.

Examples

PRINT Int(Pi)
PRINT Int(-Pi)

3
-4

' Example illustrate the use of Int function to truncate to whole number.
' See also Cint function ( for similar example).

 PRINT CInt(3.2)
 PRINT CInt(3.9)
 PRINT CInt(6)
 PRINT CInt(-7.2)
 PRINT CInt(-7.9)

3
3
6
-8
-8

The Value is not limited to the Integer size (32 bits) nor to the Long size (64 bits). It may be Float.

PRINT Int(2e60), CInt(2e60)

2E+60 -2147483648

The next example shows how Int() works on a Boolean variable.

PRINT Int(TRUE)

True

The Difference between Int() and CInt() is:

See also

Arithmetical Functions