[script] do abs(x) > epsilon instead of x != 0

Fixes a compiler warning.
This commit is contained in:
Ray Strode 2009-08-05 23:09:02 -04:00
parent 10b68cecef
commit 0b67fbbdce

View file

@ -31,6 +31,7 @@
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <values.h>
#include "script.h"
#include "script-object.h"
@ -285,7 +286,7 @@ bool script_obj_as_bool (script_obj_t *obj)
return false;
case SCRIPT_OBJ_TYPE_FLOAT:
if (obj->data.floatpoint) return true;
if (fabs (obj->data.floatpoint) > FLT_MIN) return true;
return false;
case SCRIPT_OBJ_TYPE_NULL: