project_files/hwc/rtl/pmath.h
author Wuzzy <Wuzzy2@mail.ru>
Tue, 28 Aug 2018 05:46:33 +0200
changeset 13710 0da36902e5b6
parent 11655 e15eb10f1703
child 14185 801dc57371c3
permissions -rw-r--r--
Space Invasion: Continue playing rounds in case the teams are tied at the end Rules in case of a tie: 1) Eliminate all teams not tied for the lead 2) Play another round with the remaining teams 3) Check for the winner again at the end of that round. If there's another tie, repeat the procedure

#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);

/* emscripten cannot find math.h through our cmake */
#ifdef EMSCRIPTEN
double      exp(double);
double      log(double);
double      sin(double);
double      cos(double);
double      fabs(double);
double      ceil(double);
double      sqrt(double);
double      atan(double);
double      atan2(double, double);
#endif

#endif /* PMATH_H_ */