 Functions and CALL Routines

# LOG1PX Function

Returns the log of 1 plus the argument.
 Category: Mathematical

## Syntax

 LOG1PX(x)

### Arguments

x

specifies a numeric variable, constant, or expression.

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) .

### Example 1: Computing the Log with the LOG1PX Function

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`

### Example 2: Comparing the LOG1PX Function with the LOG Function

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```

 Functions: Previous Page | Next Page | Top of Page