Browse Source

math: add (obsolete) bsd drem and finite functions

Szabolcs Nagy 11 years ago
parent
commit
5d01ab4ac6
5 changed files with 26 additions and 0 deletions
  1. 6 0
      include/math.h
  2. 7 0
      src/math/finite.c
  3. 7 0
      src/math/finitef.c
  4. 3 0
      src/math/remainder.c
  5. 3 0
      src/math/remainderf.c

+ 6 - 0
include/math.h

@@ -381,6 +381,12 @@ double      yn(int, double);
 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
 #define HUGE            3.40282346638528859812e+38F
 
+double      drem(double, double);
+float       dremf(float, float);
+
+int         finite(double);
+int         finitef(float);
+
 double      scalb(double, double);
 float       scalbf(float, float);
 

+ 7 - 0
src/math/finite.c

@@ -0,0 +1,7 @@
+#define _GNU_SOURCE
+#include <math.h>
+
+int finite(double x)
+{
+	return isfinite(x);
+}

+ 7 - 0
src/math/finitef.c

@@ -0,0 +1,7 @@
+#define _GNU_SOURCE
+#include <math.h>
+
+int finitef(float x)
+{
+	return isfinite(x);
+}

+ 3 - 0
src/math/remainder.c

@@ -1,7 +1,10 @@
 #include <math.h>
+#include "libc.h"
 
 double remainder(double x, double y)
 {
 	int q;
 	return remquo(x, y, &q);
 }
+
+weak_alias(remainder, drem);

+ 3 - 0
src/math/remainderf.c

@@ -1,7 +1,10 @@
 #include <math.h>
+#include "libc.h"
 
 float remainderf(float x, float y)
 {
 	int q;
 	return remquof(x, y, &q);
 }
+
+weak_alias(remainderf, dremf);