summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/wtf/MathExtras.h
diff options
context:
space:
mode:
Diffstat (limited to 'JavaScriptCore/wtf/MathExtras.h')
-rw-r--r--JavaScriptCore/wtf/MathExtras.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/JavaScriptCore/wtf/MathExtras.h b/JavaScriptCore/wtf/MathExtras.h
index 324300d..ee2110e 100644
--- a/JavaScriptCore/wtf/MathExtras.h
+++ b/JavaScriptCore/wtf/MathExtras.h
@@ -26,6 +26,7 @@
#ifndef WTF_MathExtras_h
#define WTF_MathExtras_h
+#include <float.h>
#include <math.h>
#include <stdlib.h>
@@ -43,11 +44,6 @@
#include <stdlib.h>
#endif
#include <limits>
-
-#if HAVE(FLOAT_H)
-#include <float.h>
-#endif
-
#endif
#ifndef M_PI
@@ -102,6 +98,8 @@ inline bool signbit(double x) { struct ieee_double *p = (struct ieee_double *)&x
#if COMPILER(MSVC) || COMPILER(RVCT)
+inline long long llround(double num) { return static_cast<long long>(num > 0 ? num + 0.5 : ceil(num - 0.5)); }
+inline long long llroundf(float num) { return static_cast<long long>(num > 0 ? num + 0.5f : ceil(num - 0.5f)); }
inline long lround(double num) { return static_cast<long>(num > 0 ? num + 0.5 : ceil(num - 0.5)); }
inline long lroundf(float num) { return static_cast<long>(num > 0 ? num + 0.5f : ceilf(num - 0.5f)); }
inline double round(double num) { return num > 0 ? floor(num + 0.5) : ceil(num - 0.5); }