IEEE_TEST(3M)

NAME
ieee_test, logb, scalb, significant - IEEE test functions for verifying standard compliance

SYNOPSIS
#include <math.h>

double logb(x)
double x;

double scalb(x,y)
double x; double y;

double significant(x)
double x;

DESCRIPTION

These functions allow users to verify compliance to ANSI/IEEE Std 754-1985 by running certain test vectors distributed by the University of California. Their use is not otherwise recommended; instead use scalbn(x,n) and ilogb(x) described in ieee_functions(3M). See the for details.

logb(x) returns the unbiased exponent of x in floating-point format, for exercising the logb(L) test vector. logb(±∞) = +∞; logb(0) = -∞ with a division by zero exception. logb(x) differs from ilogb(x) in returning a result in floating-point rather than integer format, in sometimes signaling IEEE exceptions, and in not normalizing subnormal x.

scalb(x,(double)n) returns x * 2**n computed by exponent manipulation rather than by actually performing an exponentiation or a multiplication, for exercising the scalb(S) test vector. Thus
    0 ≤ scalb(fabs(x),-logb(x)) < 2
for every x except 0, infinity and NaN. scalb(x,y) is not defined when y is not an integral value. scalb(x,y) differs from scalbn(x,n) in that the second argument is in floating-point rather than integer format.

significant(x) computes just
    scalb(x, (double) -ilogb(x)),
for exercising the fraction-part(F) test vector.

FILES
/usr/lib/libm.a

SEE ALSO
floatingpoint(3), ieee_values(3M), ieee_functions(3M), matherr(3M)