1 #ifndef MATH_SIGNUM_H_INCLUDED
2 #define MATH_SIGNUM_H_INCLUDED
22 #include <type_traits>
31 template <
typename T>
inline constexpr
41 template <
typename T>
inline constexpr
44 return (T(0) < x) - (x < T(0));
51 template <
typename T>
inline constexpr
54 return signum(x, std::is_signed<T>());
60 #endif // end_of_include_guard
constexpr int signum(T x, std::false_type)
Overload for unsigned types.
Namespace for the core simulator.