Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
ldexpl(3) OSS Library Calls Reference Manual
NAME
ldexpl - Multiplies a long double number by a power of 2
LIBRARY
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>
long double ldexpl(
long double value,
int exp
);
PARAMETERS
value Specifies the long double value to be multiplied by a power of 2.
exp Specifies the exponent for 2.
DESCRIPTION
Every nonzero number can be written uniquely as x times 2 raised to the power n, where the
mantissa (fraction), x, is in the range 0.5 ≤ | x | < 1.0, and the exponent, n, is an integer.
The ldexpl( ) function is a long double version of the ldexp( ) function; it takes a long double
argument and returns a long double result.
The ldexpl( ) function multiplies the floating-point number value by an integral power of 2.
NOTES
This function supports both IEEE Std 754-1985 floating-point and Tandem floating-point values
in the native environment. 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
Upon successful completion, the ldexpl( ) function returns a long double value equal to value
times 2 to the power exp.
For IEEE floating-point values, if the value of value is NaN, NaN is returned. If the value of
value is positive or negative infinity, the value of value is returned.
If ldexpl( ) would cause overflow, positive or negative HUGE_VALL is returned (according to
the sign of value) and errno is set to [ERANGE]. If ldexpl( ) would cause underflow, a value of
0.0 (zero) is returned and errno is set to [ERANGE].
ERRORS
If any of the following conditions occurs, the ldexpl( ) function sets errno to the corresponding
value:
[ERANGE] The value to be returned would cause an overflow or underflow.
4−88 Hewlett-Packard Company 527187-017