2020-03-17 04:31:30 +00:00
|
|
|
#ifndef _MATH_H_
|
|
|
|
#define _MATH_H_
|
|
|
|
|
2020-10-03 15:22:44 +00:00
|
|
|
#include "ultra64/types.h"
|
|
|
|
|
2020-03-17 04:31:30 +00:00
|
|
|
#define M_PI 3.14159265358979323846f
|
2020-03-21 02:09:42 +00:00
|
|
|
#define M_SQRT2 1.41421356237309504880f
|
2020-03-17 04:31:30 +00:00
|
|
|
#define FLT_MAX 340282346638528859811704183484516925440.0f
|
2020-04-19 03:28:24 +00:00
|
|
|
#define SHT_MAX 32767.0f
|
|
|
|
#define SHT_MINV (1.0f / SHT_MAX)
|
2020-05-07 23:18:09 +00:00
|
|
|
#define DEGTORAD(x) (x * M_PI / 180.0f)
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-07-07 00:15:01 +00:00
|
|
|
typedef union {
|
|
|
|
struct {
|
2020-10-03 15:22:44 +00:00
|
|
|
u32 hi;
|
|
|
|
u32 lo;
|
2020-07-07 00:15:01 +00:00
|
|
|
} word;
|
|
|
|
|
2020-10-03 15:22:44 +00:00
|
|
|
f64 d;
|
2020-07-07 00:15:01 +00:00
|
|
|
} du;
|
|
|
|
|
|
|
|
typedef union {
|
2020-10-03 15:22:44 +00:00
|
|
|
u32 i;
|
|
|
|
f32 f;
|
2020-07-07 00:15:01 +00:00
|
|
|
} fu;
|
|
|
|
|
2020-10-03 15:22:44 +00:00
|
|
|
extern f32 __libm_qnan_f;
|
2020-07-07 00:15:01 +00:00
|
|
|
|
2020-03-17 04:31:30 +00:00
|
|
|
#endif
|