35#ifndef _BLAZE_MATH_SHIMS_SIGN_H_
36#define _BLAZE_MATH_SHIMS_SIGN_H_
66template<
typename T,
typename = EnableIf_t< IsIntegral_v<T> > >
67constexpr T
sign( T a )
noexcept
69 return ( IsSigned_v<T> )
70 ? ( T(0) < a ) - ( a < T(0) )
87constexpr float sign(
float a )
noexcept
89 if ( 0.0F < a )
return 1.0F;
90 else if( a < 0.0F )
return -1.0F;
107constexpr double sign(
double a )
noexcept
109 if ( 0.0 < a )
return 1.0;
110 else if( a < 0.0 )
return -1.0;
127constexpr 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 EnableIf class template.
Header file for the IsIntegral type trait.
Header file for the IsSigned type trait.
BLAZE_ALWAYS_INLINE SIMDdouble sign(const SIMDdouble &a) noexcept=delete
Sign function for a vector of double precision floating point values.