MCPcopy Create free account
hub / github.com/apache/singa / builtin_isinf

Function builtin_isinf

include/half.hpp:546–555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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)

Callers 1

float2half_implFunction · 0.85

Calls 1

isinfFunction · 0.85

Tested by

no test coverage detected