ref: 78ed7e6a99f2ab22b725203541c77ed4626b5d49
parent: eed76191580004d5461bdf8accd8ca23e8541b57
author: Tor Andersson <tor@ccxvii.net>
date: Mon Sep 14 07:57:51 EDT 2015
Use fabs rather than integer abs for taking absolute value of floats.
--- a/jsdate.c
+++ b/jsdate.c
@@ -226,7 +226,7 @@
{
if (!isfinite(t))
return NAN;
- if (abs(t) > 8.64e15)
+ if (fabs(t) > 8.64e15)
return NAN;
return t < 0 ? -floor(-t) : floor(t);
}
--- a/jsvalue.c
+++ b/jsvalue.c
@@ -12,7 +12,7 @@
double sign = n < 0 ? -1 : 1;
if (isnan(n)) return 0;
if (n == 0 || isinf(n)) return n;
- return sign * floor(abs(n));
+ return sign * floor(fabs(n));
}
int jsV_numbertoint32(double n)