summaryrefslogtreecommitdiff
path: root/libm/fpmacros.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-04-17 12:56:57 +0000
committerEric Andersen <andersen@codepoet.org>2002-04-17 12:56:57 +0000
commit95e97072d9a261979d97bff9d82f4307c7e4e050 (patch)
treed23e845c01f05e3d2dcc004d9976e703cebf3c1f /libm/fpmacros.c
parent98832397c2155e6470119ce3e7e32ceaed4eb49f (diff)
Patch from Axel Barnitzke <barney@xkontor.com> to fix handling
of the isinf() macro, which was a casulty of my grafting the glibc header onto out math library.
Diffstat (limited to 'libm/fpmacros.c')
-rw-r--r--libm/fpmacros.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libm/fpmacros.c b/libm/fpmacros.c
index 6c5abbe87..a9f63df4b 100644
--- a/libm/fpmacros.c
+++ b/libm/fpmacros.c
@@ -165,6 +165,30 @@ long int __isfinite ( double x )
}
+/***********************************************************************
+* long int __isinff(float x) returns -1 if value represents negative
+* infinity, 1 if value represents positive infinity,
+* and 0 otherwise.
+*
+* Calls: __signbit
+* +***********************************************************************/
+long int __isinff ( float x )
+{
+ long int class = __fpclassifyf(x);
+ if ( class == FP_INFINITE ) {
+ return ( (__signbitf(x)) ? -1 : 1);
+ }
+ return 0;
+}
+
+long int __isinf ( double x )
+{
+ long int class = __fpclassify(x);
+ if ( class == FP_INFINITE ) {
+ return ( (__signbit(x)) ? -1 : 1);
+ }
+ return 0;
+}
/***********************************************************************
long int __isnanf(float x) returns nonzero if and only if x is a