35 #ifndef _BLAZE_MATH_SHIMS_SIGN_H_ 36 #define _BLAZE_MATH_SHIMS_SIGN_H_ 66 template<
typename T,
typename = EnableIf_t< IsIntegral_v<T> > >
67 inline constexpr T
sign( T a ) noexcept
69 return ( IsSigned_v<T> )
70 ? ( T(0) < a ) - ( a < T(0) )
87 inline constexpr
float sign(
float a ) noexcept
89 if ( 0.0F < a )
return 1.0F;
90 else if( a < 0.0F )
return -1.0F;
107 inline constexpr
double sign(
double a ) noexcept
109 if ( 0.0 < a )
return 1.0;
110 else if( a < 0.0 )
return -1.0;
127 inline constexpr
long double sign(
long double a ) noexcept
129 if ( 0.0L < a )
return 1.0L;
130 else if( a < 0.0L )
return -1.0L;
Header file for the IsIntegral type trait.
decltype(auto) sign(const DenseMatrix< MT, SO > &dm)
Applies the sign() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1184
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the EnableIf class template.
Header file for the IsSigned type trait.