INTZ Function


Returns the integer portion of the argument, using zero fuzzing

Category: Truncation

Syntax

INTZ ( argument )

Arguments

argument

  • is a numeric constant, variable, or expression.

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.

Examples

The following SAS statements produce these results.

SAS Statements

Results

  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

Functions:

  • 'CEIL Function' on page 431

  • 'CEILZ Function' on page 433

  • 'FLOOR Function' on page 544

  • 'FLOORZ Function' on page 546

  • 'INT Function' on page 597

  • 'ROUND Function' on page 789

  • 'ROUNDZ Function' on page 797




SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 704

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net