Functions and CALL Routines |
Category: | Mathematical |
Syntax | |
Arguments | |
Details | |
Examples | |
Example 1: Computing the Log with the LOG1PX Function | |
Example 2: Comparing the LOG1PX Function with the LOG Function | |
See Also |
Syntax |
LOG1PX(x) |
specifies a numeric variable, constant, or expression.
Details |
The LOG1PX function computes the log of 1 plus the argument. The LOG1PX function is mathematically defined by the following equation, where -1 < x:
When x is close to 0, LOG1PX(x) can be more accurate than LOG(1+x) .
Examples |
The following example computes the log of 1 plus the value 0.5.
data _null_; x=log1px(0.5); put x=; run;
SAS writes the following output to the Log:
x=0.4054651081
In the following example, the value of X is computed by using the LOG1PX function. The value of Y is computed by using the LOG function.
data _null_; x=log1px(1.e-5); put x= hex16.; y=log(1+1.e-5); put y= hex16.; run;
SAS writes the following output to the Log:
x=3EE4F8AEA9AE7317 y=3EE4F8AEA9AF0A25
See Also |
Functions: |
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.