Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
OSS Library Calls (i - m) logb(3)
NAME
logb - Computes the radix-independent exponent as a floating-point number
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 logb(
double x);
PARAMETERS
x Specifies the value for which the exponent is to be calculated.
DESCRIPTION
The logb( ) function returns the unbiased exponent part of the floating-point value given as the x
parameter. The logb( ) function calculates the integral part of the base-r logarithm (where r is the
radix of the machine’s floating-point arithmetic) of the absolute value of x and returns the result
as a signed floating-point value.
NOTES
The logb( ) 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 logb( ) function returns the exponent of x.
For IEEE floating-point data, the following are true:
• logb(NaN) returns a quiet NaN.
• When the value of x is positive or negative infinity, logb( ) returns a value of positive
infinity.
• When the value of x is 0.0 (zero), logb(0.0) returns a value of -HUGE_VAL and sets
errno to [EDOM].
For Tandem floating-point data, when x has a value of 0.0 (zero), logb( ) returns the value
-HUGE_VAL and sets errno to [EDOM].
ERRORS
If any of the following conditions occurs, the logb( ) function sets errno to the corresponding
value:
[EDOM] The x parameter is 0.0 (zero).
527187-017 Hewlett-Packard Company 4−129