Int Function
Converts a Real number to Integer. Returns the largest integer that is less than or equal to the specified value.
Syntax
Int(number)
Parameters
- number
- Specify a real number.
Return Values
Returns an Integer value of the real number used in number.
Description
Int(number) takes the value of number and returns the largest integer that is less than or equal to number.
Note
For Values Less than 0 (Negative Numbers)
If the parameter number has a value of less than 0, then the return value is rounded down to the nearest integer number. (For example, if number = -1.35 then -2 will be returned.)
See Also
Abs Function, Atan Function, Atan2 Function, Cos Function, Mod Operator, Not Operator, Sgn Function, Sin Function, Sqr Function, Str$ Function, Tan Function, Val Function
Int Function Example
Some simple examples from the Command window are as follows:
> Print Int(5.1)
5
> Print Int(0.2)
0
> Print Int(-5.1)
-6
>