14 #ifndef PAAL_FLOATING_HPP
15 #define PAAL_FLOATING_HPP
30 compare(T epsilon = std::numeric_limits<T>::epsilon()): m_epsilon(epsilon) {}
33 bool e(T a, T b)
const {
34 return std::abs(a - b) < m_epsilon;
40 bool g(T a, T b)
const {
return a > b + m_epsilon; }
43 bool ge(T a, T b)
const {
return a >= b - m_epsilon; }
46 bool le(T a, T b)
const {
return a <= b + m_epsilon; }
59 #endif // PAAL_FLOATING_HPP
static T default_epsilon()
returns default epsilon equals the smallest possible difference on doubles
bool le(T a, T b) const
less equals
double get_epsilon() const
get_epsilon used in comparison
bool g(T a, T b) const
greater
compare(T epsilon=std::numeric_limits< T >::epsilon())
constructor
bool ge(T a, T b) const
greater equals
Class for comparing floating point.
bool e(T a, T b) const
equals