Guardian Native C Library Calls Reference Manual (G06.28+, H06.05+)

logb(3) Guardian Native C Library Calls Reference Manual
NAME
logb - Computes the radix-independent exponent as a
oating-point number
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRESRL
G-series native OSS processes: /G/system/sysnn/zcresrl
H-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL
H-series OSS processes: /G/system/zdllnnn/zcredll
SYNOPSIS
#include <math.h>
double logb(
double x);
PARAMETERS
x Species the value for which the exponent is to be calculated.
DESCRIPTION
The logb() function returns the unbiased exponent part of the oating-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 machines oating-point arithmetic) of the absolute value of x and returns the result
as a signed oating-point value.
NOTES
The logb() function can be called only by native processes.
This function supports both IEEE Std 754-1985 oating-point and Tandem oating-point values.
IEEE values can include NaN and innity, 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 oating-point formats. Refer to the Guar-
dian Programmers Guide for a discussion of oating-point conversions.
RETURN VALUES
The logb() function returns the exponent of x.
For IEEE oating-point data, the following are true:
logb(NaN) returns a quiet NaN.
When the value of x is positive or negative innity, logb() returns a value of positive
innity.
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 oating-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).
430 Hewlett-Packard Company 527192-007