Browse Source

LibJS: Fix Math.SQRT1_2

The value of Math.SQRT1_2 was zero as we were dividing two integers.
Linus Groh 5 years ago
parent
commit
2f775a925b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Libraries/LibJS/Runtime/MathObject.cpp

+ 1 - 1
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)));
 }