Blaze 3.9
Greater.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_SHIMS_GREATER_H_
36#define _BLAZE_MATH_SHIMS_GREATER_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <blaze/system/Inline.h>
46
47
48namespace blaze {
49
50//=================================================================================================
51//
52// GREATER SHIM
53//
54//=================================================================================================
55
56//*************************************************************************************************
67template< typename T >
68BLAZE_ALWAYS_INLINE constexpr bool greater_backend( const T& a, const T& b )
69 noexcept( IsBuiltin_v<T> )
70{
71 return a > b;
72}
74//*************************************************************************************************
75
76
77//*************************************************************************************************
91BLAZE_ALWAYS_INLINE constexpr bool greater_backend( float a, float b ) noexcept
92{
93 return ( b - a ) > 1E-8F;
94}
96//*************************************************************************************************
97
98
99//*************************************************************************************************
113BLAZE_ALWAYS_INLINE constexpr bool greater_backend( double a, double b ) noexcept
114{
115 return ( b - a ) > 1E-8;
116}
118//*************************************************************************************************
119
120
121//*************************************************************************************************
135BLAZE_ALWAYS_INLINE constexpr bool greater_backend( long double a, long double b ) noexcept
136{
137 return ( b - a ) > 1E-10L;
138}
140//*************************************************************************************************
141
142
143//*************************************************************************************************
155template< typename T1, typename T2 >
156BLAZE_ALWAYS_INLINE constexpr bool greater( const T1& a, const T2& b )
157 noexcept( IsBuiltin_v< CommonType_t<T1,T2> > )
158{
159 return greater_backend< CommonType_t<T1,T2> >( a, b );
160}
161//*************************************************************************************************
162
163} // namespace blaze
164
165#endif
Header file for the CommonType type trait.
Header file for the IsBuiltin type trait.
BLAZE_ALWAYS_INLINE constexpr bool greater(const T1 &a, const T2 &b) noexcept(IsBuiltin_v< CommonType_t< T1, T2 > >)
Generic greater-than comparison.
Definition: Greater.h:156
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
System settings for the inline keywords.