[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    ieee_test(3M) manual page Table of Contents

Name

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

Synopsis

cc [ flag ... ] file ... -lm [ library ... ]

#include <math.h>

double logb(double x);

double scalb(double x, double y);

double significand(double x);

MT-Level

MT-Safe

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.

logb(x) returns the unbiased exponent of x in floating-point format, for exercising the logb(L) test vector. logb(±if) = +if; logb(0) = -if with a division by 0 exception.

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 if and . scalb(x,y) is not defined when y is not an integral value.

If x equals sig * 2**n with 1 <= sig < 2, then significand(x) returns sig for exercising the fraction-part(F) test vector. significand(x) is not defined when x is either 0, ±if or .

Return Values

For exceptional cases, matherr(3M) tabulates the values to be returned as dictated by various Standards.

See Also

matherr(3M)


Table of Contents