Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ significand(3M) — Sun WorkShop 3.0.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ieee_values(3M)

ieee_functions(3M)

matherr(3M)

IEEE_TEST(3M)  —  MATHEMATICAL LIBRARY

NAME

logb, scalb, significand − IEEE test functions for verifying standard compliance

SYNOPSIS

#include <math.h>

double logb(double x);

double scalb(double x, double y);

double significand(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 Floating-Point Programmer’s Guide 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 0 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, ∞ 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. 

significand(x) computes just

scalb(x, (double) −ilogb(x))

for exercising the fraction-part(F) test vector.  significand(x) is not defined when x is either 0, ±∞ or NaN. 

RETURN VALUES

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

SEE ALSO

ieee_values(3M), ieee_functions(3M), matherr(3M)

Sun Release 4.1  —  Last change: 22 Jul 1994

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026