cc [ flag ... ] file ... -lm [ library ... ]
int ilogb(double x);
int isnan(double x);
double copysign(double x, double y);
double fabs(double x);
double fmod(double x, double y);
double nextafter(double x, double y);
double remainder(double x, double y);
double scalbn(double x, int n);
ilogb(x) returns the unbiased exponent of x in integer format. ilogb(±\(if) = +MAXINT and ilogb(0) = -MAXINT; <values.h> defines MAXINT as the largest int. ilogb(x) never generates an exception. When x is subnormal, ilogb(x) returns an exponent computed as if x were first normalized.
isnan(x) returns 1 if x is NaN; otherwise it returns 0.
copysign(x,y) returns a value with the magnitude of x and with the sign bit of y.
fabs(x) returns the absolute value of x.
nextafter(x,y) returns the next machine representable number from x in the direction y.
remainder(x,y) and fmod(x,y) return a remainder of x with respect to y; that is, the result r is one of the numbers that differ from x by an integral multiple of y. Thus (x-r)/y is an integral value, even though it might exceed MAXINT, the largest int defined in <values.h> if it were explicitly computed as an int. Both functions return one of the two such r smallest in magnitude. remainder(x,y) is the operation specified in ANSI/IEEE Std 754-1985; the result of fmod(x,y) may differ from remainder's result by ±y. The magnitude of remainder's result cannot exceed half that of y; its sign might not agree with either x or y. The magnitude of fmod's result is less than that of y; its sign agrees with that of x. Neither function can generate an exception as long as both arguments are normal or subnormal.
remainder(x,0), fmod(x,0), remainder(\(if,y), and fmod(\(if,y) are invalid operations; in IEEE754 mode (i.e. the -xlibmieee cc compilation option), a NaN is returned.
scalbn(x,n) returns x*2**n computed by exponent manipulation rather than by actually performing an exponentiation or a multiplication. Thus
1 <= scalbn(fabs(x),-ilogb(x)) < 2
for every x except 0, \(if, and NaN.
Created by unroff & hp-tools. © by Hans-Peter Bischof. All Rights Reserved (1997).
Last modified 21/April/97