Downgrade some ERRs to TRACEs
[openal-soft.git] / common / math_defs.h
blobcbe9091f32a5f951951b3642076fe104f4bb975b
1 #ifndef AL_MATH_DEFS_H
2 #define AL_MATH_DEFS_H
4 #include <math.h>
5 #ifdef HAVE_FLOAT_H
6 #include <float.h>
7 #endif
9 #define F_PI (3.14159265358979323846f)
10 #define F_PI_2 (1.57079632679489661923f)
11 #define F_TAU (6.28318530717958647692f)
13 #ifndef FLT_EPSILON
14 #define FLT_EPSILON (1.19209290e-07f)
15 #endif
17 #ifndef HUGE_VALF
18 static const union msvc_inf_hack {
19 unsigned char b[4];
20 float f;
21 } msvc_inf_union = {{ 0x00, 0x00, 0x80, 0x7F }};
22 #define HUGE_VALF (msvc_inf_union.f)
23 #endif
25 #ifndef HAVE_LOG2F
26 static inline float log2f(float f)
28 return logf(f) / logf(2.0f);
30 #endif
32 #define DEG2RAD(x) ((float)(x) * (F_PI/180.0f))
33 #define RAD2DEG(x) ((float)(x) * (180.0f/F_PI))
35 #endif /* AL_MATH_DEFS_H */