DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
(BSD System Compatibility)

ieee_functions(3bsd)


ieee_functions, fp_class, isnan, copysign, scalbn -- (BSD) miscellaneous functions for IEEE arithmetic

Synopsis

   /usr/ucb/cc [flag . . . ] file . . .
   

#include <fp.h> #include <math.h> #include <stdio.h>

enum fp_class_type fp_class(double x);

int isnan(double x);

double copysign(double x, double y);

double scalbn(double x, int n);

Description

Most of these functions provide capabilities required by ANSI/IEEE Std 754-1985 or suggested in its appendix.

fp_class(x) corresponds to the IEEE's class() and classifies x as zero, subnormal, normal, INFINITY, or quiet or signaling NaN; /usr/ucbinclude/sys/ieeefp.h defines enum fp_class_type. The following function returns 0 if the indicated condition is not satisfied:


isnan(x)
returns 1 if x is NaN

copysign(x,y) returns x with y's sign bit.

scalbn(x,n) returns x* 2**n computed by exponent manipulation rather than by actually performing an exponentiation or a multiplication. Thus

   1 LESS THAN OR EQUAL TO scalbn(fabs(x),-ilogb(x)) < 2

for every x except 0, INFINITY, and NaN.

Files


/usr/ucbinclude/sys/ieeefp.h

/usr/ucbinclude/math.h

/usr/include/values.h

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004