mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +00:00
LibM: Add (not very good) round() implementation
This commit is contained in:
parent
fa40b725f9
commit
e97a229b90
Notes:
sideshowbarker
2024-07-19 07:34:09 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/e97a229b906
1 changed files with 8 additions and 0 deletions
|
@ -389,6 +389,14 @@ long double frexpl(long double, int*)
|
|||
return 0;
|
||||
}
|
||||
|
||||
double round(double value)
|
||||
{
|
||||
// FIXME: Please fix me. I am naive.
|
||||
if (value >= 0.0)
|
||||
return (double)(int)(value + 0.5);
|
||||
return (double)(int)(value - 0.5);
|
||||
}
|
||||
|
||||
float roundf(float value)
|
||||
{
|
||||
// FIXME: Please fix me. I am naive.
|
||||
|
|
Loading…
Add table
Reference in a new issue