FLOOR Function
Returns the largest integer that is less than or
equal to the argument, fuzzed to avoid unexpected floating-point results.
Syntax
Required Argument
argument
specifies a numeric
constant, variable, or expression.
Details
If the argument is within
1E-12 of an integer, the function returns that integer.
Comparisons
Unlike the FLOORZ function,
the FLOOR function fuzzes the result. If the argument is within 1E-12
of an integer, the FLOOR function fuzzes the result to be equal to
that integer. The FLOORZ function does not fuzz the result. Therefore,
with the FLOORZ function you might get unexpected results.
Example
The following SAS statements
produce these results.
|
|
var1=2.1;
a=floor(var1);
put a;
|
|
var2=-2.4;
b=floor(var2);
put b;
|
|
|
|
d=floor(1.-1.e-13);
put d;
|
|
|
|
f=floor(-223.456);
put f;
|
|