|
MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
|
#include <signum.hpp>
Public Types | |
| using | result_type = T |
Public Member Functions | |
| constexpr result_type | operator() (const T &v) const |
Static Public Member Functions | |
| static constexpr result_type | apply (const T &v) |
| 1, -1 or 0. | |
| using mtl::functor::scalar::signum< T >::result_type = T |
|
inlinestaticconstexpr |
1, -1 or 0.
An unsigned value is never negative, and T{-1} would not even compile for it. A NaN is returned as is, as NumPy's sign does, rather than reported as 0 (#838).
|
inlineconstexpr |