summaryrefslogtreecommitdiffstats
path: root/newlib/libc/include/math.h
diff options
context:
space:
mode:
authorThomas Fitzsimmons <fitzsim@redhat.com>2002-06-07 21:59:57 +0000
committerThomas Fitzsimmons <fitzsim@redhat.com>2002-06-07 21:59:57 +0000
commit0953fe640f177b565578ed7ecc77169ec1a914fa (patch)
treef63c2a55e4d0e5a067da91cea95ae88a7c15af7e /newlib/libc/include/math.h
parent2bd6505b3991588a15c865618e1edb76d4a6373c (diff)
downloadcygnal-0953fe640f177b565578ed7ecc77169ec1a914fa.tar.gz
cygnal-0953fe640f177b565578ed7ecc77169ec1a914fa.tar.bz2
cygnal-0953fe640f177b565578ed7ecc77169ec1a914fa.zip
* libm/common/s_fdim.c: New file.
* libm/common/s_fma.c: Likewise. * libm/common/s_fmax.c: Likewise. * libm/common/s_fmin.c: Likewise. * libm/common/s_fpclassify.c: Likewise. * libm/common/s_lrint.c: Likewise. * libm/common/s_lround.c: Likewise. * libm/common/s_nearbyint.c: Likewise. * libm/common/s_remquo.c: Likewise. * libm/common/s_round.c: Likewise. * libm/common/s_scalbln.c: Likewise. * libm/common/s_signbit.c: Likewise. * libm/common/s_trunc.c: Likewise. * libm/common/sf_fdim.c: Likewise. * libm/common/sf_fma.c: Likewise. * libm/common/sf_fmax.c: Likewise. * libm/common/sf_fmin.c: Likewise. * libm/common/sf_lrint.c: Likewise. * libm/common/sf_lround.c: Likewise. * libm/common/sf_nearbyint.c: Likewise. * libm/common/sf_remquo.c: Likewise. * libm/common/sf_round.c: Likewise. * libm/common/sf_scalbln.c: Likewise. * libm/common/sf_trunc.c: Likewise. * libm/math/w_exp2.c: Likewise. * libm/math/w_tgamma.c: Likewise. * libm/math/wf_exp2.c: Likewise. * libm/math/wf_tgamma.c: Likewise. * libm/mathfp/s_exp2.c: Likewise. * libm/mathfp/s_tgamma.c: Likewise. * libm/mathfp/sf_exp2.c: Likewise. * libm/mathfp/sf_tgamma.c: Likewise. * libm/math/er_gamma.c: Fix return value. * libm/math/erf_gamma.c: Likewise. * libm/mathfp/er_gamma.c: Likewise. * libm/mathfp/erf_gamma.c: Likewise. * libc/include/math.h (!__STRICT_ANSI__): Include ISOC99-specific declarations and macros. Regenerated all Makefile.in, aclocal.m4 and configure files to use new libtool macros in top-level libtool.m4
Diffstat (limited to 'newlib/libc/include/math.h')
-rw-r--r--newlib/libc/include/math.h81
1 files changed, 81 insertions, 0 deletions
diff --git a/newlib/libc/include/math.h b/newlib/libc/include/math.h
index 0b9ef594e..ba156e47e 100644
--- a/newlib/libc/include/math.h
+++ b/newlib/libc/include/math.h
@@ -66,6 +66,57 @@ extern double fmod _PARAMS((double, double));
#ifndef __STRICT_ANSI__
+/* ISO C99 types and macros. */
+
+#ifndef FLT_EVAL_METHOD
+#define FLT_EVAL_METHOD 0
+typedef float float_t;
+typedef double double_t;
+#endif /* FLT_EVAL_METHOD */
+
+#define FP_NAN 0
+#define FP_INFINITE 1
+#define FP_ZERO 2
+#define FP_SUBNORMAL 3
+#define FP_NORMAL 4
+
+extern int __fpclassifyf (float x);
+extern int __fpclassifyd (double x);
+
+#define fpclassify(x) \
+ (__extension__ ({__typeof__(x) __x = (x); \
+ (sizeof (__x) == sizeof (float)) ? __fpclassifyf(__x) : __fpclassifyd(__x);}))
+
+#define isfinite(x) \
+ (__extension__ ({__typeof__(x) __x = (x); \
+ fpclassify(__x) != FP_INFINITE && fpclassify(__x) != FP_NAN;}))
+#define isnormal(x) \
+ (__extension__ ({__typeof__(x) __x = (x); \
+ fpclassify(__x) == FP_NORMAL;}))
+#define signbit(x) \
+ (__extension__ ({__typeof__(x) __x = (x); \
+ (sizeof(__x) == sizeof(float)) ? __signbitf(__x) : __signbitd(__x);}))
+
+#define isgreater(x,y) \
+ (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \
+ !isunordered(__x,__y) && (__x > __y);}))
+#define isgreaterequal(x,y) \
+ (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \
+ !isunordered(__x,__y) && (__x >= __y);}))
+#define isless(x,y) \
+ (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \
+ !isunordered(__x,__y) && (__x < __y);}))
+#define islessequal(x,y) \
+ (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \
+ !isunordered(__x,__y) && (__x <= __y);}))
+#define islessgreater(x,y) \
+ (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \
+ !isunordered(__x,__y) && (__x < __y || __x > __y);}))
+
+#define isunordered(x,y) \
+ (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \
+ fpclassify(__x) == FP_NAN || fpclassify(__y) == FP_NAN;}))
+
/* Non ANSI double precision functions. */
extern double infinity _PARAMS((void));
@@ -82,6 +133,21 @@ extern double nextafter _PARAMS((double, double));
extern double rint _PARAMS((double));
extern double scalbn _PARAMS((double, int));
+extern double exp2 _PARAMS((double));
+extern double scalbln _PARAMS((double, long int));
+extern double tgamma _PARAMS((double));
+extern double nearbyint _PARAMS((double));
+extern long int lrint _PARAMS((double));
+extern double round _PARAMS((double));
+extern long int lround _PARAMS((double));
+extern double trunc _PARAMS((double));
+extern double remquo _PARAMS((double, double, int *));
+extern double copysign _PARAMS((double, double));
+extern double fdim _PARAMS((double, double));
+extern double fmax _PARAMS((double, double));
+extern double fmin _PARAMS((double, double));
+extern double fma _PARAMS((double, double, double));
+
#ifndef __math_68881
extern double log1p _PARAMS((double));
extern double expm1 _PARAMS((double));
@@ -152,6 +218,21 @@ extern float fmodf _PARAMS((float, float));
/* Other single precision functions. */
+extern float exp2f _PARAMS((float));
+extern float scalblnf _PARAMS((float, long int));
+extern float tgammaf _PARAMS((float));
+extern float nearbyintf _PARAMS((float));
+extern long int lrintf _PARAMS((float));
+extern float roundf _PARAMS((float));
+extern long int lroundf _PARAMS((float));
+extern float truncf _PARAMS((float));
+extern float remquof _PARAMS((float, float, int *));
+extern float copysignf _PARAMS((float, float));
+extern float fdimf _PARAMS((float, float));
+extern float fmaxf _PARAMS((float, float));
+extern float fminf _PARAMS((float, float));
+extern float fmaf _PARAMS((float, float, float));
+
extern float infinityf _PARAMS((void));
extern float nanf _PARAMS((void));
extern int isnanf _PARAMS((float));