From 2f775a925b61b3f7b2b73dbfeedcefb39e5765d3 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sun, 5 Apr 2020 14:16:26 +0100 Subject: [PATCH] LibJS: Fix Math.SQRT1_2 The value of Math.SQRT1_2 was zero as we were dividing two integers. --- Libraries/LibJS/Runtime/MathObject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibJS/Runtime/MathObject.cpp b/Libraries/LibJS/Runtime/MathObject.cpp index 613f6cef8f..e1f0fae96e 100644 --- a/Libraries/LibJS/Runtime/MathObject.cpp +++ b/Libraries/LibJS/Runtime/MathObject.cpp @@ -49,7 +49,7 @@ MathObject::MathObject() put("LOG2E", Value(log2(M_E))); put("LOG10E", Value(log10(M_E))); put("PI", Value(M_PI)); - put("SQRT1_2", Value(::sqrt(1 / 2))); + put("SQRT1_2", Value(::sqrt(1.0 / 2.0))); put("SQRT2", Value(::sqrt(2))); }