diff --git a/userspace/libraries/LibC/include/math.h b/userspace/libraries/LibC/include/math.h index 9b62cbc3..df8d8a12 100644 --- a/userspace/libraries/LibC/include/math.h +++ b/userspace/libraries/LibC/include/math.h @@ -191,9 +191,9 @@ long lroundl(long double); double modf(double, double*); float modff(float, float*); long double modfl(long double, long double*); -#define nan(tagp) __builtin_nan(tagp) -#define nanf(tagp) __builtin_nanf(tagp) -#define nanl(tagp) __builtin_nanl(tagp) +double nan(const char*); +float nanf(const char*); +long double nanl(const char*); double nearbyint(double); float nearbyintf(float); long double nearbyintl(long double); diff --git a/userspace/libraries/LibC/math.cpp b/userspace/libraries/LibC/math.cpp index 67b7537c..355039df 100644 --- a/userspace/libraries/LibC/math.cpp +++ b/userspace/libraries/LibC/math.cpp @@ -249,6 +249,9 @@ BAN_FUNC1(logb) FUNC_EXPR1_RET(lrint, long, BAN::Math::rint(a)) FUNC_EXPR1_RET(lround, long, BAN::Math::round(a)) BAN_FUNC2_PTR(modf) +double nan(const char* tagp) { return __builtin_nan(tagp); } +float nanf(const char* tagp) { return __builtin_nanf(tagp); } +long double nanl(const char* tagp) { return __builtin_nanl(tagp); } FUNC_EXPR1(nearbyint, BAN::Math::rint(a)) FUNC_EXPR2(nextafter, nextafter_impl(a, b)) FUNC_EXPR2_TYPE(nexttoward, long double, nextafter_impl(a, b))