diff options
author | dzwdz | 2022-08-29 13:57:47 +0200 |
---|---|---|
committer | dzwdz | 2022-08-29 13:58:02 +0200 |
commit | 4ae57a7fb13e68c5e6f1c1246a867555dbd986db (patch) | |
tree | 3bee7f7eee21e9f2ed3b9f07dd1671a1c230cf66 /src/user/lib/math.c | |
parent | edb7fc07bf93e4a1883cccf45ad7a4b2cbf390d9 (diff) |
user/lua: implement the bare minimum for it to link and "run"
Diffstat (limited to 'src/user/lib/math.c')
-rw-r--r-- | src/user/lib/math.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/user/lib/math.c b/src/user/lib/math.c new file mode 100644 index 0000000..db1f2ec --- /dev/null +++ b/src/user/lib/math.c @@ -0,0 +1,32 @@ +#include <math.h> +#include <user/lib/panic.h> + +int abs(int i) { + return i < 0 ? -i : i; +} + + +// TODO port a libm +#pragma GCC diagnostic ignored "-Wunused-parameter" +double acos(double x) { __libc_panic("unimplemented"); } +double asin(double x) { __libc_panic("unimplemented"); } +double atan2(double x, double y) { __libc_panic("unimplemented"); } +double cos(double x) { __libc_panic("unimplemented"); } +double cosh(double x) { __libc_panic("unimplemented"); } +double sin(double x) { __libc_panic("unimplemented"); } +double sinh(double x) { __libc_panic("unimplemented"); } +double tan(double x) { __libc_panic("unimplemented"); } +double tanh(double x) { __libc_panic("unimplemented"); } + +double fabs(double x) { __libc_panic("unimplemented"); } +double floor(double x) { __libc_panic("unimplemented"); } +double ceil(double x) { __libc_panic("unimplemented"); } +double log(double x) { __libc_panic("unimplemented"); } +double log2(double x) { __libc_panic("unimplemented"); } +double log10(double x) { __libc_panic("unimplemented"); } +double exp(double x) { __libc_panic("unimplemented"); } +double fmod(double x, double y) { __libc_panic("unimplemented"); } +double frexp(double num, int *exp) { __libc_panic("unimplemented"); } +double ldexp(double x, int exp) { __libc_panic("unimplemented"); } +double pow(double x, double y) { __libc_panic("unimplemented"); } +double sqrt(double x) { __libc_panic("unimplemented"); } |