author | Wuzzy <almikes@aol.com> |
Sat, 30 Sep 2017 23:52:08 +0200 | |
changeset 12627 | 07fdda8c13a2 |
parent 11660 | e15eb10f1703 |
child 14190 | 801dc57371c3 |
permissions | -rw-r--r-- |
7983 | 1 |
#ifndef PMATH_H_ |
2 |
#define PMATH_H_ |
|
3 |
||
4 |
#include <stdint.h> |
|
8047
25a4daa6473c
cleanup headers, remove -I . from rtl lib to save a few warnings
koda
parents:
7983
diff
changeset
|
5 |
#include <math.h> |
7983 | 6 |
|
7 |
#define fpcrtl_min(a, b) ((a) < (b) ? (a) : (b)) |
|
8 |
#define fpcrtl_max(a, b) ((a) > (b) ? (a) : (b)) |
|
9 |
||
10 |
float fpcrtl_power(float base, float exponent); |
|
11 |
||
12 |
/* Currently the games only uses sign of an integer */ |
|
13 |
int fpcrtl_signi(int x); |
|
14 |
||
15 |
float fpcrtl_csc(float x); |
|
16 |
||
17 |
#define fpcrtl_arctan2(y, x) atan2(y, x) |
|
18 |
||
19 |
float __attribute__((overloadable)) fpcrtl_abs(float x); |
|
20 |
double __attribute__((overloadable)) fpcrtl_abs(double x); |
|
21 |
int __attribute__((overloadable)) fpcrtl_abs(int x); |
|
22 |
int64_t __attribute__((overloadable)) fpcrtl_abs(int64_t x); |
|
23 |
||
11660 | 24 |
/* emscripten cannot find math.h through our cmake */ |
25 |
#ifdef EMSCRIPTEN |
|
26 |
double exp(double); |
|
27 |
double log(double); |
|
28 |
double sin(double); |
|
29 |
double cos(double); |
|
30 |
double fabs(double); |
|
31 |
double ceil(double); |
|
32 |
double sqrt(double); |
|
33 |
double atan(double); |
|
34 |
double atan2(double, double); |
|
35 |
#endif |
|
36 |
||
7983 | 37 |
#endif /* PMATH_H_ */ |