Returns the nearest integer whose magnitude is not larger than the real value of an expression that represents a numerical value:
ANINT(x) = INT(x + 0.5) if x > 0
ANINT(x) = INT(x - 0.5) if x < 0
The value of the mathematical function INT of a variable x is equal to x if x is an integer. If x is not an integer, then INT(x) is equal to the nearest integer to x, whose magnitude is not greater than the magnitude of x. Thus,
INT(-7.0) = -7, INT(-4.8) = -4, and INT(4.8) = 4.
Format
ANINT (x)
Argument
x | Any valid expression that evaluates to a real number. |
Examples
The following functions show how ANINT rounds the results to the nearest integer:
Function | ANINT(-0.9) |
Result | -1 |
Function | ANINT(0.33) |
Result | 0 |
Function | ANINT(-4.6) |
Result | -5 |
Function | AINT(4.6) |
Result | 5 |