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.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/JavaScriptCore/wtf/MathExtras.h b/JavaScriptCore/wtf/MathExtras.h
index 8a8741c..095549e 100644
--- a/JavaScriptCore/wtf/MathExtras.h
+++ b/JavaScriptCore/wtf/MathExtras.h
@@ -145,6 +145,13 @@ inline float nextafterf(float x, float y) { return x > y ? x - FLT_EPSILON : x +
inline double copysign(double x, double y) { return _copysign(x, y); }
inline int isfinite(double x) { return _finite(x); }
+// MSVC's math.h does not currently supply log2.
+inline double log2(double num)
+{
+ // This constant is roughly M_LN2, which is not provided by default on Windows.
+ return log(num) / 0.693147180559945309417232121458176568;
+}
+
// Work around a bug in Win, where atan2(+-infinity, +-infinity) yields NaN instead of specific values.
inline double wtf_atan2(double x, double y)
{