24#ifndef quantlib_comparison_hpp
25#define quantlib_comparison_hpp
27#include <ql/types.hpp>
28#include <ql/shared_ptr.hpp>
68 Real diff = std::fabs(x-y);
71 if (x == 0.0 || y == 0.0)
72 return diff < (tolerance * tolerance);
74 return diff <= tolerance*std::fabs(x) &&
75 diff <= tolerance*std::fabs(y);
85 if (x == 0.0 || y == 0.0)
86 return diff < (tolerance * tolerance);
88 return diff <= tolerance*std::fabs(x) &&
89 diff <= tolerance*std::fabs(y);
99 Real diff = std::fabs(x-y);
102 if (x == 0.0 || y == 0.0)
103 return diff < (tolerance * tolerance);
105 return diff <= tolerance*std::fabs(x) ||
106 diff <= tolerance*std::fabs(y);
116 if (x == 0.0 || y == 0.0)
117 return diff < (tolerance * tolerance);
119 return diff <= tolerance*std::fabs(x) ||
120 diff <= tolerance*std::fabs(y);
155 const ext::shared_ptr<T>& y)
const {
std::size_t Size
size of a container
bool close(const Quantity &m1, const Quantity &m2, Size n)
bool close_enough(const Quantity &m1, const Quantity &m2, Size n)
QL_DEPRECATED typedef ext::shared_ptr< T > first_argument_type
bool operator()(const ext::shared_ptr< T > &x, const ext::shared_ptr< T > &y) const
QL_DEPRECATED typedef ext::shared_ptr< T > second_argument_type
QL_DEPRECATED typedef bool result_type
compare two objects by date