/* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ /* bos720 src/bos/usr/include/values.h 1.12.1.5 */ /* */ /* Licensed Materials - Property of IBM */ /* */ /* COPYRIGHT International Business Machines Corp. 1985,1994 */ /* All Rights Reserved */ /* */ /* US Government Users Restricted Rights - Use, duplication or */ /* disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */ /* */ /* IBM_PROLOG_END_TAG */ /* @(#)88 1.12.1.5 src/bos/usr/include/values.h, libm, bos720 7/25/02 19:30:18 */ /* * COMPONENT_NAME: (LIBM) Header file of common values * * FUNCTIONS: * * ORIGINS: 27 * * (C) COPYRIGHT International Business Machines Corp. 1985, 1994 * All Rights Reserved * Licensed Materials - Property of IBM * * US Government Users Restricted Rights - Use, duplication or * disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */ #ifndef _H_VALUES #define _H_VALUES #include #ifdef __cplusplus extern "C" { #endif #define BITSPERBYTE CHAR_BIT #define BITS(type) (BITSPERBYTE * sizeof(type)) /* short, regular and long ints with only the high-order bit turned on */ #define HIBITS ((short)-32768) /* ((short)(1 << BITS(short) - 1)) */ #define HIBITI ((int)-2147483648) /* (1 << BITS(int) - 1) */ #ifdef __64BIT__ #define HIBITL ((long)-9223372036854775808) /* (1L << BITS(long) - 1) */ #else /* __64BIT__ */ #define HIBITL ((long)-2147483648) /* (1L << BITS(long) - 1) */ #endif /* __64BIT__ */ /* largest short, regular and long int */ #define MAXSHORT ((short)~HIBITS) #define MAXINT ((int)~HIBITI) #define MAXLONG ((long)~HIBITL) /* various values that describe the binary floating-point representation * DMAXEXP - the maximum exponent of a double (as returned by frexp()) * FMAXEXP - the maximum exponent of a float (as returned by frexp()) * DMINEXP - the minimum exponent of a double (as returned by frexp()) * FMINEXP - the minimum exponent of a float (as returned by frexp()) * MAXDOUBLE - the largest double ((_EXPBASE ** DMAXEXP) * (1 - (_EXPBASE ** -DSIGNIF))) * MAXFLOAT - the largest float ((_EXPBASE ** FMAXEXP) * (1 - (_EXPBASE ** -FSIGNIF))) * MINDOUBLE - the smallest double (_EXPBASE ** (DMINEXP - 1)) * MINFLOAT - the smallest float (_EXPBASE ** (FMINEXP - 1)) * DSIGNIF - the number of significant bits in a double * FSIGNIF - the number of significant bits in a float * DMAXPOWTWO - the largest power of two exactly representable as a double * FMAXPOWTWO - the largest power of two exactly representable as a float * LN_MAXDOUBLE - the natural log of the largest double -- log(MAXDOUBLE) * LN_MINDOUBLE - the natural log of the smallest double -- log(MINDOUBLE) * _DEXPLEN - the number of bits for the exponent of a double (11) * _FEXPLEN - the number of bits for the exponent of a float (8) * * These values are no longer defined, however, they are reference in other * defines to show how they were calculated. * * _EXPBASE - the exponent base (2) * _IEEE - 1 if IEEE standard representation is used (1) * _LENBASE - the number of bits in the exponent base (1 for binary) * _HIDDENBIT - 1 if high-significance bit of mantissa is implicit */ /* these are for the IEEE format machines */ #define MAXDOUBLE 1.7976931348623157e+308 /* MAXFLOAT is also defined in math.h */ #ifndef MAXFLOAT extern unsigned int _SFPMAX; #define MAXFLOAT (*((float *) (&_SFPMAX))) #endif #define MINDOUBLE 4.94065645841246544e-324 #define MINFLOAT ((float)1.40129846432481707e-45) #define DMINEXP -1073 /* (-(DMAXEXP + DSIGNIF - _HIDDENBIT - 3)) */ #define FMINEXP -148 /* (-(FMAXEXP + FSIGNIF - _HIDDENBIT - 3)) */ #define DSIGNIF 53 /* (BITS(double) - _DEXPLEN + _HIDDENBIT - 1) */ #define FSIGNIF 24 /* (BITS(float) - _FEXPLEN + _HIDDENBIT - 1) */ #define DMAXPOWTWO 4.503599627370496E15 /* ((double)(1L << BITS(long) - 2)*/ /* * (1L<