diff options
author | Linus Groh <mail@linusgroh.de> | 2020-04-05 14:16:26 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-05 16:01:46 +0200 |
commit | 2f775a925b61b3f7b2b73dbfeedcefb39e5765d3 (patch) | |
tree | eaeaf7b1d66ff89ed3b20a8ad90bfceee5f5ba13 | |
parent | 500f6d9e3a8f664264a34daa8425b36b327f8377 (diff) | |
download | serenity-2f775a925b61b3f7b2b73dbfeedcefb39e5765d3.zip |
LibJS: Fix Math.SQRT1_2
The value of Math.SQRT1_2 was zero as we were dividing two integers.
-rw-r--r-- | Libraries/LibJS/Runtime/MathObject.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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))); } |