LibM: Implement the missing parts of the round family

This commit is contained in:
Mițca Dumitru 2021-03-14 18:19:40 +02:00 committed by Andreas Kling
parent 03b2d30836
commit c9601cdee3
Notes: sideshowbarker 2024-07-18 21:21:47 +09:00
2 changed files with 36 additions and 0 deletions

View file

@ -868,6 +868,36 @@ long double roundl(long double value) NOEXCEPT
return internal_to_integer(value, RoundingMode::ToEven);
}
long lroundf(float value) NOEXCEPT
{
return internal_to_integer(value, RoundingMode::ToEven);
}
long lround(double value) NOEXCEPT
{
return internal_to_integer(value, RoundingMode::ToEven);
}
long lroundl(long double value) NOEXCEPT
{
return internal_to_integer(value, RoundingMode::ToEven);
}
long long llroundf(float value) NOEXCEPT
{
return internal_to_integer(value, RoundingMode::ToEven);
}
long long llround(double value) NOEXCEPT
{
return internal_to_integer(value, RoundingMode::ToEven);
}
long long llroundd(long double value) NOEXCEPT
{
return internal_to_integer(value, RoundingMode::ToEven);
}
float floorf(float value) NOEXCEPT
{
return internal_to_integer(value, RoundingMode::Down);

View file

@ -123,6 +123,12 @@ long double truncl(long double) NOEXCEPT;
double round(double) NOEXCEPT;
float roundf(float) NOEXCEPT;
long double roundl(long double) NOEXCEPT;
long lroundf(float) NOEXCEPT;
long lround(double) NOEXCEPT;
long lroundl(long double) NOEXCEPT;
long long llroundf(float) NOEXCEPT;
long long llround(double) NOEXCEPT;
long long llroundd(long double) NOEXCEPT;
double rint(double) NOEXCEPT;
float rintf(float) NOEXCEPT;
long lrintl(long double) NOEXCEPT;