libm: Add two missing functions

This commit is contained in:
K. Lange 2021-10-07 07:20:50 +09:00
parent 65ad24537f
commit 44eefc2e43
3 changed files with 13 additions and 1 deletions

View File

@ -36,6 +36,8 @@ extern double sinh(double x);
extern double tan(double x); extern double tan(double x);
extern double tanh(double x); extern double tanh(double x);
extern double atan(double x); extern double atan(double x);
extern double log1p(double x);
extern double expm1(double x);
extern double modf(double x, double *iptr); extern double modf(double x, double *iptr);

2
kuroko

@ -1 +1 @@
Subproject commit 7e96bdeec1e587a5304c2c8871d88f523df18334 Subproject commit fa6dbc8365ed442f4fbb619827feb08b93a71e2f

View File

@ -1,6 +1,7 @@
/* STUB MATH LIBRARY */ /* STUB MATH LIBRARY */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <math.h>
extern char * _argv_0; extern char * _argv_0;
#define BAD do { if (getenv("LIBM_DEBUG")) { fprintf(stderr, "%s called bad math function %s\n", _argv_0, __func__); } } while (0) #define BAD do { if (getenv("LIBM_DEBUG")) { fprintf(stderr, "%s called bad math function %s\n", _argv_0, __func__); } } while (0)
@ -39,3 +40,12 @@ double log2(double x) {
return 0.0; return 0.0;
} }
double log1p(double x) {
BAD;
return log(x+1.0);
}
double expm1(double x) {
BAD;
return exp(x) - 1.0;
}