LibM: Add nan{f, l}

This commit is contained in:
Mițca Dumitru 2021-03-07 23:53:29 +02:00 committed by Andreas Kling
parent efe4845c56
commit b07310dc8b
Notes: sideshowbarker 2024-07-18 21:35:39 +09:00
2 changed files with 19 additions and 0 deletions

View File

@ -303,6 +303,21 @@ static FloatT internal_copysign(FloatT x, FloatT y) NOEXCEPT
extern "C" {
float nanf(const char* s) NOEXCEPT
{
return __builtin_nanf(s);
}
double nan(const char* s) NOEXCEPT
{
return __builtin_nan(s);
}
long double nanl(const char* s) NOEXCEPT
{
return __builtin_nanl(s);
}
double trunc(double x) NOEXCEPT
{
return internal_to_integer(x, RoundingMode::ToZero);

View File

@ -77,6 +77,10 @@ __BEGIN_DECLS
#define DOUBLE_MAX ((double)0b0111111111101111111111111111111111111111111111111111111111111111)
#define DOUBLE_MIN ((double)0b0000000000010000000000000000000000000000000000000000000000000000)
long double nanl(const char*) NOEXCEPT;
double nan(const char*) NOEXCEPT;
float nanf(const char*) NOEXCEPT;
double acos(double) NOEXCEPT;
float acosf(float) NOEXCEPT;
double asin(double) NOEXCEPT;