30 #ifndef __CLAW_REAL_NUMBER_HPP__ 31 #define __CLAW_REAL_NUMBER_HPP__ 56 return std::abs(v) <= 1
57 ? std::numeric_limits<T>::epsilon()
58 : std::abs(v) * std::numeric_limits<T>::epsilon();
69 friend std::istream& ::operator>><>(std::istream& is,
81 self_type abs()
const;
83 bool operator<(
const self_type& that)
const;
84 bool operator<=(
const self_type& that)
const;
85 bool operator>(
const self_type& that)
const;
86 bool operator>=(
const self_type& that)
const;
87 bool operator==(
const self_type& that)
const;
88 bool operator!=(
const self_type& that)
const;
90 self_type operator+(
const self_type& that)
const;
91 self_type operator-(
const self_type& that)
const;
92 self_type operator*(
const self_type& that)
const;
93 self_type operator/(
const self_type& that)
const;
95 self_type& operator+=(
const self_type& that);
96 self_type& operator-=(
const self_type& that);
97 self_type& operator*=(
const self_type& that);
98 self_type& operator/=(
const self_type& that);
100 std::ostream& output(std::ostream& os)
const;
102 template <
typename U>
110 value_type m_epsilon;
117 template <
typename T>
118 struct numeric_limits<
claw::real_number<T> > :
public numeric_limits<T>
121 template <
typename T>
126 template <
typename T>
129 template <
typename T>
132 template <
typename T>
133 std::ostream& operator<<(std::ostream& os, const claw::real_number<T>&
self);
134 template <
typename T>
137 #include "claw/real_number.tpp" 139 #endif // __CLAW_REAL_NUMBER_HPP__ Custom precision real numbers.
This class generates an epsilon value of a given precision.
This is the main namespace.