FUZZ Function


Returns the nearest integer if the argument is within 1E - 12

Category: Truncation

Syntax

FUZZ ( argument )

Arguments

argument

  • is numeric.

Details

The FUZZ function returns the nearest integer value if the argument is within 1E-12 of the integer (that is, if the absolute difference between the integer and argument is less than 1E-12). Otherwise, the argument is returned.

Examples

SAS Statements

Results

   var1=5.9999999999999;   x=fuzz(var1);   put x 16.14   
   6.000000000000000   
   x=fuzz(5.99999999);   put x 16.14;   
   5.999999990000000   



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