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.
This commit is contained in:
Andreas Kling 2020-04-15 19:12:10 +02:00
parent e97a229b90
commit beda751d33
Notes: sideshowbarker 2024-07-19 07:34:06 +09:00

View file

@ -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)