INTZ Function
Returns the integer portion of the argument, using zero fuzzing.
| Categories: | Truncation |
| CAS |
Details
The following rules
apply:
-
If the value of the argument is an exact integer, INTZ returns that integer.
-
If the argument is positive and not an integer, INTZ returns the largest integer that is less than the argument.
-
If the argument is negative and not an integer, INTZ returns the smallest integer that is greater than the argument.
Comparisons
Unlike the INT function,
the INTZ function uses zero fuzzing. If the argument is within 1E-12
of an integer, the INT function fuzzes the result to be equal to that
integer. The INTZ function does not fuzz the result. Therefore, with
the INTZ function you might get unexpected results.
Example
The following SAS statements
produce these results:
|
SAS Statement
|
Result
|
|---|---|
var1=2.1; a=intz(var1); put a; |
2 |
var2=-2.4; b=intz(var2); put b; |
-2 |
var3=1+1.e-11; c=intz(var3); put c; |
1 |
f=intz(-1.6); put f; |
-1 |
See Also
Copyright © SAS Institute Inc. All Rights Reserved.
Last updated: March 16, 2017