math: add (obsolete) bsd drem and finite functions
This commit is contained in:
parent
ebbaf2180e
commit
5d01ab4ac6
5 changed files with 26 additions and 0 deletions
|
|
@ -381,6 +381,12 @@ double yn(int, double);
|
||||||
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
|
||||||
#define HUGE 3.40282346638528859812e+38F
|
#define HUGE 3.40282346638528859812e+38F
|
||||||
|
|
||||||
|
double drem(double, double);
|
||||||
|
float dremf(float, float);
|
||||||
|
|
||||||
|
int finite(double);
|
||||||
|
int finitef(float);
|
||||||
|
|
||||||
double scalb(double, double);
|
double scalb(double, double);
|
||||||
float scalbf(float, float);
|
float scalbf(float, float);
|
||||||
|
|
||||||
|
|
|
||||||
7
src/math/finite.c
Normal file
7
src/math/finite.c
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#define _GNU_SOURCE
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
int finite(double x)
|
||||||
|
{
|
||||||
|
return isfinite(x);
|
||||||
|
}
|
||||||
7
src/math/finitef.c
Normal file
7
src/math/finitef.c
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#define _GNU_SOURCE
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
int finitef(float x)
|
||||||
|
{
|
||||||
|
return isfinite(x);
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include "libc.h"
|
||||||
|
|
||||||
double remainder(double x, double y)
|
double remainder(double x, double y)
|
||||||
{
|
{
|
||||||
int q;
|
int q;
|
||||||
return remquo(x, y, &q);
|
return remquo(x, y, &q);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
weak_alias(remainder, drem);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include "libc.h"
|
||||||
|
|
||||||
float remainderf(float x, float y)
|
float remainderf(float x, float y)
|
||||||
{
|
{
|
||||||
int q;
|
int q;
|
||||||
return remquof(x, y, &q);
|
return remquof(x, y, &q);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
weak_alias(remainderf, dremf);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue