| 544 | /// \retval true if infinity |
| 545 | /// \retval false else |
| 546 | template<typename T> bool builtin_isinf(T arg) |
| 547 | { |
| 548 | #if HALF_ENABLE_CPP11_CMATH |
| 549 | return std::isinf(arg); |
| 550 | #elif defined(_MSC_VER) |
| 551 | return !::_finite(static_cast<double>(arg)) && !::_isnan(static_cast<double>(arg)); |
| 552 | #else |
| 553 | return arg == std::numeric_limits<T>::infinity() || arg == -std::numeric_limits<T>::infinity(); |
| 554 | #endif |
| 555 | } |
| 556 | |
| 557 | /// Check for NaN. |
| 558 | /// \tparam T argument type (builtin floating-point type) |
no test coverage detected