diff options
Diffstat (limited to 'include/math.h')
| -rw-r--r-- | include/math.h | 81 |
1 files changed, 14 insertions, 67 deletions
diff --git a/include/math.h b/include/math.h index ba64e75117c..bb953739684 100644 --- a/include/math.h +++ b/include/math.h @@ -1,4 +1,4 @@ -/* $OpenBSD: math.h,v 1.20 2008/07/24 09:41:58 martynas Exp $ */ +/* $OpenBSD: math.h,v 1.21 2008/09/07 20:36:07 martynas Exp $ */ /* * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. @@ -63,18 +63,6 @@ extern char __nan[]; : (sizeof (x) == sizeof (double)) ? \ __isfinite(x) \ : __isfinitel(x)) -#define isinf(x) \ - ((sizeof (x) == sizeof (float)) ? \ - isinff(x) \ - : (sizeof (x) == sizeof (double)) ? \ - __isinf(x) \ - : __isinfl(x)) -#define isnan(x) \ - ((sizeof (x) == sizeof (float)) ? \ - isnanf(x) \ - : (sizeof (x) == sizeof (double)) ? \ - __isnan(x) \ - : __isnanl(x)) #define isnormal(x) \ ((sizeof (x) == sizeof (float)) ? \ __isnormalf(x) \ @@ -97,6 +85,19 @@ extern char __nan[]; #define isunordered(x, y) (isnan(x) || isnan(y)) #endif /* __ISO_C_VISIBLE >= 1999 */ +#define isinf(x) \ + ((sizeof (x) == sizeof (float)) ? \ + isinff(x) \ + : (sizeof (x) == sizeof (double)) ? \ + __isinf(x) \ + : __isinfl(x)) +#define isnan(x) \ + ((sizeof (x) == sizeof (float)) ? \ + isnanf(x) \ + : (sizeof (x) == sizeof (double)) ? \ + __isnan(x) \ + : __isnanl(x)) + /* * XOPEN/SVID */ @@ -125,51 +126,7 @@ extern int signgam; #endif /* __BSD_VISIBLE || __XPG_VISIBLE */ #if __BSD_VISIBLE -enum fdversion {fdlibm_ieee = -1, fdlibm_svid, fdlibm_xopen, fdlibm_posix}; - -#define _LIB_VERSION_TYPE enum fdversion -#define _LIB_VERSION _fdlib_version - -/* if global variable _LIB_VERSION is not desirable, one may - * change the following to be a constant by: - * #define _LIB_VERSION_TYPE const enum version - * In that case, after one initializes the value _LIB_VERSION (see - * s_lib_version.c) during compile time, it cannot be modified - * in the middle of a program - */ -extern _LIB_VERSION_TYPE _LIB_VERSION; - -#define _IEEE_ fdlibm_ieee -#define _SVID_ fdlibm_svid -#define _XOPEN_ fdlibm_xopen -#define _POSIX_ fdlibm_posix - -#ifndef __cplusplus -struct exception { - int type; - char *name; - double arg1; - double arg2; - double retval; -}; -#endif /* !__cplusplus */ - #define HUGE MAXFLOAT - -/* - * set X_TLOSS = pi*2**52, which is possibly defined in <values.h> - * (one may replace the following line by "#include <values.h>") - */ - -#define X_TLOSS 1.41484755040568800000e+16 - -#define DOMAIN 1 -#define SING 2 -#define OVERFLOW 3 -#define UNDERFLOW 4 -#define TLOSS 5 -#define PLOSS 6 - #endif /* __BSD_VISIBLE */ __BEGIN_DECLS @@ -215,9 +172,7 @@ extern double exp2(double); extern double expm1(double); extern int ilogb(double); extern double log1p(double); -#if 0 extern double log2(double); -#endif extern double logb(double); extern double scalbn(double, int); #if 0 @@ -253,11 +208,9 @@ extern double nextafter(double, double); extern double nexttoward(double, long double); #endif -#if 0 extern double fdim(double, double); extern double fmax(double, double); extern double fmin(double, double); -#endif #if 0 extern double fma(double, double, double); @@ -292,10 +245,6 @@ extern int finite(double); extern double gamma_r(double, int *); extern double lgamma_r(double, int *); -#ifdef __LIBM_PRIVATE -extern int matherr(struct exception *); -#endif /* __LIBM_PRIVATE */ - /* * IEEE Test Vector */ @@ -375,11 +324,9 @@ extern float nextafterf(float, float); extern float nexttowardf(float, long double); #endif -#if 0 extern float fdimf(float, float); extern float fmaxf(float, float); extern float fminf(float, float); -#endif #if 0 extern float fmaf(float, float, float); |
