diff --git a/Userland/Libraries/LibM/math.cpp b/Userland/Libraries/LibM/math.cpp index 068dfb7d88..2ccdac6272 100644 --- a/Userland/Libraries/LibM/math.cpp +++ b/Userland/Libraries/LibM/math.cpp @@ -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); diff --git a/Userland/Libraries/LibM/math.h b/Userland/Libraries/LibM/math.h index 5f769fbc2d..224eb283a9 100644 --- a/Userland/Libraries/LibM/math.h +++ b/Userland/Libraries/LibM/math.h @@ -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;