Jelajahi Sumber

Revert to the previous version and use "fabs" for floats in tests.

mingodad 8 tahun lalu
induk
melakukan
c0bc928b17
1 mengubah file dengan 3 tambahan dan 12 penghapusan
  1. 3 12
      SquiLu/sqstdlib/sqstdmath.cpp

+ 3 - 12
SquiLu/sqstdlib/sqstdmath.cpp

@@ -80,18 +80,9 @@ static SQRESULT math_random(HSQUIRRELVM v) {
 
 static SQRESULT math_abs(HSQUIRRELVM v)
 {
-	if(sq_gettype(v,2) == OT_INTEGER)
-    {
-        SQInteger n;
-        sq_getinteger(v,2,&n);
-        sq_pushinteger(v,(SQInteger)abs(n));
-    }
-    else
-    {
-        SQFloat n;
-        sq_getfloat(v,2,&n);
-        sq_pushfloat(v,abs(n));
-    }
+    SQInteger n;
+    sq_getinteger(v,2,&n);
+    sq_pushinteger(v,(SQInteger)abs(n));
 	return 1;
 }