int()
Return the largest integer that is not greater than the argument.
Syntax
int(number)
Parameter
Parameter | Definition |
---|---|
number | numeric value or numeric variable |
Description
The int() function returns the largest integer that is not greater than number. It is equivalent to the C library floor(3)function.
Example
The following statements use the int() function to return only the integer portion of a real number. (Each statement returns the integer 3.)
print(int(3.14) . "\n");
print(int(3.48) . "\n");
print(int(3.52) . "\n");
print(int(3.75) . "\n");
print(int(3.99) . "\n");
print(int(3.48) . "\n");
print(int(3.52) . "\n");
print(int(3.75) . "\n");
print(int(3.99) . "\n");
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*