diff --git a/include/__math/rounding_functions.h b/include/__math/rounding_functions.h index 29e42fd..7943b6f 100644 --- a/include/__math/rounding_functions.h +++ b/include/__math/rounding_functions.h @@ -204,7 +204,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double rint(_A1 __x) _NOEXCEP // round -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float round(float __x) _NOEXCEPT { return __builtin_round(__x); } +_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float round(float __x) _NOEXCEPT { return __builtin_roundf(__x); } template _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double round(double __x) _NOEXCEPT { @@ -222,7 +222,7 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double round(_A1 __x) _NOEXCE // trunc -_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float trunc(float __x) _NOEXCEPT { return __builtin_trunc(__x); } +_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI float trunc(float __x) _NOEXCEPT { return __builtin_truncf(__x); } template _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI double trunc(double __x) _NOEXCEPT { diff --git a/include/math.h b/include/math.h index 0598973..376bbf7 100644 --- a/include/math.h +++ b/include/math.h @@ -290,6 +290,9 @@ float truncf(float x); long double truncl(long double x); */ +# ifdef __CUDACC__ +# include +# else # include <__config> @@ -323,7 +326,7 @@ extern "C++" { # undef isinf # endif -# ifdef isnan +# if defined(isnan) && !defined(_LIBCPP_MSVCRT) # undef isnan # endif @@ -503,6 +506,8 @@ using std::__math::trunc; # endif // __cplusplus +# endif // __CUDACC__ + #else // _LIBCPP_MATH_H // This include lives outside the header guard in order to support an MSVC