Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
log1p(3) OSS Library Calls Reference Manual
NAME
log1p - Computes the natural logarithm function of 1.0 plus x
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRESRL
G-series native OSS processes: /G/system/sysnn/zcresrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcredll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycredll
SYNOPSIS
#include <math.h>
double log1p(
double x);
PARAMETERS
x Is the value for which the natural logarithm is to be calculated.
DESCRIPTION
The log1p( ) function returns the natural logarithm of (1.0 + x). The value of the x parameter
must be greater than -1.0.
NOTES
The log1p( ) function can be called only by native processes.
This function supports both IEEE Std 754-1985 floating-point and Tandem floating-point values.
IEEE values can include NaN and infinity, and the sign of 0.0 (zero) can be either positive or
negative. Refer to the fp_class(3) reference page for a description of IEEE value classes.
Guardian functions are available to convert between floating-point formats. Refer to the Guar-
dian Programmer’s Guide for a discussion of floating-point conversions.
RETURN VALUES
The log1p( ) function returns the natural logarithm of (1.0 + x).
When the value of x is -1.0, log1p( ) returns -HUGE_VALand sets errno to [ERANGE].
For IEEE floating-point values, if the value of x is NaN, NaN is returned. When the value of x is
less than -1.0, log1p( ) returns NaN and sets errno to [EDOM]. When the value of x is positive
infinity, log1p( ) returns positive infinity.
For Tandem floating-point values, when the value of x is less than -1.0, log1p( ) returns -
HUGE_VAL and sets errno to [EDOM].
ERRORS
If any of the following conditions occur, the log1p( ) function sets errno to the corresponding
value:
[EDOM] The value of the x parameter is less than -1.0.
[ERANGE] The value of the x parameter is -1.0.
RELATED INFORMATION
Functions: fp_class(3), isnan(3).
STANDARDS CONFORMANCE
The XPG4 Version 2 specification leaves some features to the implementing vendor to define.
The following feature is affected in the HP implementation:
• For IEEE floating-point values, this function does not set errno to [EDOM] if the value
of x is NaN.
4−118 Hewlett-Packard Company 527187-017