mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
LibM: Implement some naive functionality to make VVVVVV run
This commit is contained in:
parent
65cb406327
commit
3b2f20ed4d
Notes:
sideshowbarker
2024-07-19 10:04:21 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/3b2f20ed4d3
1 changed files with 24 additions and 4 deletions
|
@ -64,11 +64,11 @@ double pow(double x, double y)
|
|||
return exp(y * log(x));
|
||||
}
|
||||
|
||||
double ldexp(double, int exp)
|
||||
double ldexp(double x, int exp)
|
||||
{
|
||||
(void)exp;
|
||||
ASSERT_NOT_REACHED();
|
||||
return 0;
|
||||
// FIXME: Please fix me. I am naive.
|
||||
double val = pow(2, exp);
|
||||
return x * val;
|
||||
}
|
||||
|
||||
double tanh(double x)
|
||||
|
@ -290,6 +290,16 @@ float roundf(float value)
|
|||
return (float)(int)(value - 0.5f);
|
||||
}
|
||||
|
||||
double floor(double value)
|
||||
{
|
||||
return (int)value;
|
||||
}
|
||||
|
||||
double rint(double value)
|
||||
{
|
||||
return (int)roundf(value);
|
||||
}
|
||||
|
||||
float ceilf(float value)
|
||||
{
|
||||
// FIXME: Please fix me. I am naive.
|
||||
|
@ -300,6 +310,16 @@ float ceilf(float value)
|
|||
return as_int + 1;
|
||||
}
|
||||
|
||||
double ceil(double value)
|
||||
{
|
||||
// FIXME: Please fix me. I am naive.
|
||||
int as_int = (int)value;
|
||||
if (value == (double)as_int) {
|
||||
return (double)as_int;
|
||||
}
|
||||
return as_int + 1;
|
||||
}
|
||||
|
||||
double modf(double x, double* intpart)
|
||||
{
|
||||
*intpart = (double)((int)(x));
|
||||
|
|
Loading…
Add table
Reference in a new issue