summaryrefslogtreecommitdiffstats
path: root/src/newt/native/NewtCommon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/newt/native/NewtCommon.c')
-rw-r--r--src/newt/native/NewtCommon.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/newt/native/NewtCommon.c b/src/newt/native/NewtCommon.c
index d580012ef..ec10b2da5 100644
--- a/src/newt/native/NewtCommon.c
+++ b/src/newt/native/NewtCommon.c
@@ -27,6 +27,7 @@
*/
#include "NewtCommon.h"
#include <string.h>
+#include <math.h>
static const char * const ClazzNameRuntimeException = "java/lang/RuntimeException";
static jclass runtimeExceptionClz=NULL;
@@ -166,3 +167,7 @@ void NewtCommon_ReleaseJNIEnv (int shallBeDetached) {
}
}
+int NewtCommon_isFloatZero(float f) {
+ // EPSILON = 1.1920929E-7f; // Float.MIN_VALUE == 1.4e-45f ; double EPSILON 2.220446049250313E-16d
+ return fabsf(f) < 1.1920929E-7f;
+}