ape: floating point improvements (thanks spew)

This commit is contained in:
aiju 2018-05-24 13:40:44 +01:00
parent 930efe67e8
commit be3809866c
10 changed files with 27 additions and 0 deletions

View file

@ -15,6 +15,7 @@ extern double asin(double);
extern double atan(double);
extern double atan2(double, double);
extern double cos(double);
extern double hypot(double, double);
extern double sin(double);
extern double tan(double);
extern double cosh(double);
@ -36,6 +37,7 @@ extern double NaN(void);
extern int isNaN(double);
extern double Inf(int);
extern int isInf(double, int);
extern double fmin(double, double);
#ifdef _RESEARCH_SOURCE
/* does >> treat left operand as unsigned ? */

View file

@ -15,6 +15,7 @@ extern double asin(double);
extern double atan(double);
extern double atan2(double, double);
extern double cos(double);
extern double hypot(double, double);
extern double sin(double);
extern double tan(double);
extern double cosh(double);
@ -36,6 +37,7 @@ extern double NaN(void);
extern int isNaN(double);
extern double Inf(int);
extern int isInf(double, int);
extern double fmin(double, double);
#ifdef _RESEARCH_SOURCE
/* does >> treat left operand as unsigned ? */

View file

@ -37,6 +37,7 @@ extern double NaN(void);
extern int isNaN(double);
extern double Inf(int);
extern int isInf(double, int);
extern double fmin(double, double);
#ifdef _RESEARCH_SOURCE
/* does >> treat left operand as unsigned ? */

View file

@ -15,6 +15,7 @@ extern double asin(double);
extern double atan(double);
extern double atan2(double, double);
extern double cos(double);
extern double hypot(double, double);
extern double sin(double);
extern double tan(double);
extern double cosh(double);
@ -36,6 +37,7 @@ extern double NaN(void);
extern int isNaN(double);
extern double Inf(int);
extern int isInf(double, int);
extern double fmin(double, double);
#ifdef _RESEARCH_SOURCE
/* does >> treat left operand as unsigned ? */

View file

@ -15,6 +15,7 @@ extern double asin(double);
extern double atan(double);
extern double atan2(double, double);
extern double cos(double);
extern double hypot(double, double);
extern double sin(double);
extern double tan(double);
extern double cosh(double);
@ -36,6 +37,7 @@ extern double NaN(void);
extern int isNaN(double);
extern double Inf(int);
extern int isInf(double, int);
extern double fmin(double, double);
#ifdef _RESEARCH_SOURCE
/* does >> treat left operand as unsigned ? */

View file

@ -15,6 +15,7 @@ extern double asin(double);
extern double atan(double);
extern double atan2(double, double);
extern double cos(double);
extern double hypot(double, double);
extern double sin(double);
extern double tan(double);
extern double cosh(double);
@ -36,6 +37,7 @@ extern double NaN(void);
extern int isNaN(double);
extern double Inf(int);
extern int isInf(double, int);
extern double fmin(double, double);
#ifdef _RESEARCH_SOURCE
/* does >> treat left operand as unsigned ? */

View file

@ -15,6 +15,7 @@ extern double asin(double);
extern double atan(double);
extern double atan2(double, double);
extern double cos(double);
extern double hypot(double, double);
extern double sin(double);
extern double tan(double);
extern double cosh(double);
@ -36,6 +37,7 @@ extern double NaN(void);
extern int isNaN(double);
extern double Inf(int);
extern int isInf(double, int);
extern double fmin(double, double);
#ifdef _RESEARCH_SOURCE
/* does >> treat left operand as unsigned ? */

View file

@ -15,6 +15,7 @@ extern double asin(double);
extern double atan(double);
extern double atan2(double, double);
extern double cos(double);
extern double hypot(double, double);
extern double sin(double);
extern double tan(double);
extern double cosh(double);
@ -36,6 +37,7 @@ extern double NaN(void);
extern int isNaN(double);
extern double Inf(int);
extern int isInf(double, int);
extern double fmin(double, double);
#ifdef _RESEARCH_SOURCE
/* does >> treat left operand as unsigned ? */

View file

@ -0,0 +1,11 @@
#include <math.h>
double
fmin(double a, double b)
{
if(isNaN(a))
return b;
if(isNaN(b))
return a;
return a < b ? a : b;
}

View file

@ -10,6 +10,7 @@ OFILES=\
fabs.$O\
floor.$O\
fmod.$O\
fmin.$O\
gamma.$O\
hypot.$O\
j0.$O\