From beda751d33c55b3f722016cef8b9d3161c4aecb4 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 15 Apr 2020 19:12:10 +0200 Subject: [PATCH] LibJS: Math.round() should call round() instead of roundf() Neither LibM functions are very strong right now, but let's at least call the right one. --- Libraries/LibJS/Runtime/MathObject.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Libraries/LibJS/Runtime/MathObject.cpp b/Libraries/LibJS/Runtime/MathObject.cpp index d26f3b9a22..36f075093e 100644 --- a/Libraries/LibJS/Runtime/MathObject.cpp +++ b/Libraries/LibJS/Runtime/MathObject.cpp @@ -108,8 +108,7 @@ Value MathObject::round(Interpreter& interpreter) auto number = interpreter.argument(0).to_number(); if (number.is_nan()) return js_nan(); - // FIXME: Use ::round() instead of ::roundf(). - return Value(::roundf(number.as_double())); + return Value(::round(number.as_double())); } Value MathObject::max(Interpreter& interpreter)