Integer function
Syntax
Integer(decimal)
Description
Use the Integer function to convert decimal to an integer (32 bit signed twos complement number) by truncating any fraction part towards zero and returns the result as an Integer value.
Parameters
| Parameter | Description |
|---|---|
|
decimal |
A decimal number to be truncated to an integer. |
Returns
Returns an Integer equal to decimal truncated to a whole integer. If decimal is outside the range that can be represented by an integer type, the result isn't defined.
Differences between Int and Integer
There is one primary difference between the Int function and the Integer function.
-
The Int function rounds to a number in floating-decimal-point representation with a range of -9,999,999,999,999,999,999,999,999,999,999 to 9,999,999,999,999,999,999,999,999,999,999.
-
The Integer function truncates to a number in 32 bit binary twos-complement representation with a range of -2,147,483,648 to 2,147,483,647.
Related Topics