project_files/hwc/rtl/pmath.h
author unc0rr
Tue, 15 Mar 2016 22:29:40 +0300
changeset 11632 cac74d9075be
parent 8047 25a4daa6473c
child 11655 e15eb10f1703
permissions -rw-r--r--
logging via physfs (grafted from f0dcdbb9b2fef96188c5d90547b12201228ce878)

#ifndef PMATH_H_
#define PMATH_H_

#include <stdint.h>
#include <math.h>

#define     fpcrtl_min(a, b)                ((a) < (b) ? (a) : (b))
#define     fpcrtl_max(a, b)                ((a) > (b) ? (a) : (b))

float       fpcrtl_power(float base, float exponent);

/* Currently the games only uses sign of an integer */
int         fpcrtl_signi(int x);

float       fpcrtl_csc(float x);

#define     fpcrtl_arctan2(y, x)            atan2(y, x)

float       __attribute__((overloadable))   fpcrtl_abs(float x);
double      __attribute__((overloadable))   fpcrtl_abs(double x);
int         __attribute__((overloadable))   fpcrtl_abs(int x);
int64_t     __attribute__((overloadable))   fpcrtl_abs(int64_t x);

#endif /* PMATH_H_ */