LibM: Add remainder{f, l}

These just forward their arguments to fmod, but I think that should be
fine.
This commit is contained in:
Mițca Dumitru 2021-03-14 20:25:04 +02:00 committed by Andreas Kling
parent e4197b7854
commit 32b9437c13
Notes: sideshowbarker 2024-07-18 21:21:20 +09:00
2 changed files with 19 additions and 0 deletions

View file

@ -631,6 +631,22 @@ float fmodf(float index, float period) NOEXCEPT
return index - trunc(index / period) * period;
}
// FIXME: These aren't exactly like fmod, but these definitions are probably good enough for now
long double remainderl(long double x, long double y) NOEXCEPT
{
return fmodl(x, y);
}
double remainder(double x, double y) NOEXCEPT
{
return fmod(x, y);
}
float remainderf(float x, float y) NOEXCEPT
{
return fmodf(x, y);
}
long double expl(long double exponent) NOEXCEPT
{
long double res = 0;

View file

@ -107,6 +107,9 @@ float fabsf(float) NOEXCEPT;
long double fmodl(long double, long double) NOEXCEPT;
double fmod(double, double) NOEXCEPT;
float fmodf(float, float) NOEXCEPT;
long double remainderl(long double, long double) NOEXCEPT;
double remainder(double, double) NOEXCEPT;
float remainderf(float, float) NOEXCEPT;
long double nanl(const char*) NOEXCEPT;
double nan(const char*) NOEXCEPT;
float nanf(const char*) NOEXCEPT;