Chapter Contents |
Previous |
Next |
INT |
Category: | Truncation |
Syntax | |
Arguments | |
Details | |
Examples | |
See Also |
Syntax |
INT(argument) |
Details |
The INT function returns the integer portion of the argument (truncates the decimal portion). If the argument's value is within 10**(-12) of an integer, the function results in that integer. If the value of argument is positive, INT(argument) has the same result as FLOOR(argument). If the value of argument is negative, INT(argument) has the same result as CEIL(argument).
Examples |
SAS Statement | Results |
---|---|
var1=2.1; x=int(var1); put x=; |
2 |
var2=-2.4; y=int(var2); put y=; |
-2 |
a=int(3); put a=; |
3 |
b=int(-1.6); put b=; |
-1 |
See Also |
Functions:
|
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.