Add floating point epsilons

This commit is contained in:
mazmazz 2019-01-07 04:40:19 -05:00
parent 05a1a7e24a
commit d34e1fd4e9
1 changed files with 9 additions and 0 deletions

View File

@ -453,6 +453,15 @@ INT32 I_GetKey(void);
#define max(x, y) (((x) > (y)) ? (x) : (y))
#endif
// Floating point comparison epsilons from float.h
#ifndef FLT_EPSILON
#define FLT_EPSILON 1.1920928955078125e-7f
#endif
#ifndef DBL_EPSILON
#define DBL_EPSILON 2.2204460492503131e-16
#endif
// An assert-type mechanism.
#ifdef PARANOIA
#define I_Assert(e) ((e) ? (void)0 : I_Error("assert failed: %s, file %s, line %d", #e, __FILE__, __LINE__))