author | unC0Rr |
Thu, 19 Dec 2024 14:18:55 +0100 | |
branch | transitional_engine |
changeset 16081 | 6633961698ad |
parent 14218 | 3e551b0535fb |
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 |
||
14218 | 10 |
#define fpcrtl_power(a, b) pow(a, b) |
7983 | 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); |
|
14206
801dc57371c3
Pas2C: Fix bad C typedefs for Pascal data types Extended and Real
Wuzzy <Wuzzy2@mail.ru>
parents:
11655
diff
changeset
|
21 |
long double __attribute__((overloadable)) fpcrtl_abs(long double x); |
7983 | 22 |
int __attribute__((overloadable)) fpcrtl_abs(int x); |
23 |
int64_t __attribute__((overloadable)) fpcrtl_abs(int64_t x); |
|
24 |
||
11655 | 25 |
/* emscripten cannot find math.h through our cmake */ |
26 |
#ifdef EMSCRIPTEN |
|
27 |
double exp(double); |
|
28 |
double log(double); |
|
29 |
double sin(double); |
|
30 |
double cos(double); |
|
31 |
double fabs(double); |
|
14206
801dc57371c3
Pas2C: Fix bad C typedefs for Pascal data types Extended and Real
Wuzzy <Wuzzy2@mail.ru>
parents:
11655
diff
changeset
|
32 |
float fabsf(float); |
801dc57371c3
Pas2C: Fix bad C typedefs for Pascal data types Extended and Real
Wuzzy <Wuzzy2@mail.ru>
parents:
11655
diff
changeset
|
33 |
long double fabsl(long double); |
11655 | 34 |
double ceil(double); |
35 |
double sqrt(double); |
|
36 |
double atan(double); |
|
37 |
double atan2(double, double); |
|
38 |
#endif |
|
39 |
||
7983 | 40 |
#endif /* PMATH_H_ */ |