HP-UX Reference (11i v1 05/09) - 3 Library Functions A-M (vol 6)
l
logb(3M) logb(3M)
NAME
logb( ) - radix-independent exponent
SYNOPSIS
#include <math.h>
double logb(double x);
DESCRIPTION
The logb() function computes the exponent of x. Formally, the return value is the integral part of log
base r of |x| as a signed floating point value, for nonzero x, where r is the radix of the machine’s floating-
point arithmetic.
The
logb() function is recommended by the IEEE-754 standard for floating-point arithmetic. The
ISO/ANSI C committee has approved the
logb() function for inclusion in the C9X draft standard.
To use this function, compile either with the default
-Ae option or with the -Aa and -D_HPUX_SOURCE
options. Make sure your program includes <
math.h>. Link in the math library by specifying -lm on the
compiler or linker command line.
RETURN VALUE
Upon successful completion,
logb() returns the exponent of x.
If x is NaN, logb() returns NaN.
If x is ±INFINITY, logb() returns +INFINITY.
If x is zero,
logb() returns −HUGE_VAL and sets errno to [EDOM].
ERRORS
If logb() fails, errno is set to the following value.
[EDOM] x is zero.
SEE ALSO
ilogb(3M), scalb(3M), scalbn(3M), math(5), limits(5).
STANDARDS CONFORMANCE
logb(): SVID3, XPG4.2
Section 3−−534 Hewlett-Packard Company − 1 − HP-UX 11i Version 1: September 2005