IEEE_TEST(3) BSD Programmer's Manual IEEE_TEST(3)NAME
logb, logbf, scalb, scalbf, significand, significandf - IEEE test func-
tions
SYNOPSIS
#include <math.h>
double
logb(double x);
float
logbf(float x);
double
scalb(double x, double n);
float
scalbf(float x, float n);
double
significand(double x);
float
significandf(float x);
DESCRIPTION
These functions allow users to test conformance to IEEE 754. Their use
is not otherwise recommended.
logb(x) and logbf(x) return x's exponent n, a signed integer converted to
double-precision floating-point. logb(+-infinity) = +infinity; logb(0) =
-infinity with a division by zero exception.
scalbn(x, n) and scalbnf(x, n) return x*(2**n) computed by exponent ma-
nipulation.
significand(x) and significandf(x) return sig, where x := sig * 2**n with
1 <= sig < 2. significand(x) and significandf(x) are not defined when x
is 0, +-infinity, or NaN.
ERRORS
For scalb() or scalbf(), if the result would overflow or underflow, then:
_IEEE_ The return value is +-Inf or +-0, respectively. The sign of
the result matches x.
_POSIX_ Same as _IEEE_, but errno is also set to ERANGE.
_XOPEN_ Same as _POSIX_, but errno is only set if matherr(3) returns 0.
The exception type is OVERFLOW or UNDERFLOW, respectively.
_SVID_ Same as _XOPEN_.
SEE ALSOieee(3), math(3)BSDI BSD/OS March 4, 1998 1