| 424 | /// \retval true if not a number |
| 425 | /// \retval false else |
| 426 | template<typename T> bool builtin_isnan(T arg) |
| 427 | { |
| 428 | #if HALF_ENABLE_CPP11_CMATH |
| 429 | #ifdef __clang__ |
| 430 | #pragma GCC diagnostic push |
| 431 | #pragma GCC diagnostic ignored "-Wtautological-constant-compare" |
| 432 | #endif |
| 433 | return std::isnan(arg); |
| 434 | #ifdef __clang__ |
| 435 | #pragma GCC diagnostic pop |
| 436 | #endif |
| 437 | #elif defined(_MSC_VER) |
| 438 | return ::_isnan(static_cast<double>(arg)) != 0; |
| 439 | #else |
| 440 | return arg != arg; |
| 441 | #endif |
| 442 | } |
| 443 | |
| 444 | /// Check sign. |
| 445 | /// \tparam T argument type (builtin floating point type) |
no test coverage detected