93 #ifndef GEOS_MATH_DD_H 94 #define GEOS_MATH_DD_H 110 static constexpr
double SPLIT = 134217729.0;
119 DD(
double p_hi,
double p_lo) : hi(p_hi), lo(p_lo) {};
120 DD(
double x) : hi(x), lo(0.0) {};
121 DD() : hi(0.0), lo(0.0) {};
125 return hi == rhs.
hi && lo == rhs.
lo;
130 return hi != rhs.
hi || lo != rhs.
lo;
135 return (hi < rhs.
hi) || (hi == rhs.
hi && lo < rhs.
lo);
140 return (hi < rhs.
hi) || (hi == rhs.
hi && lo <= rhs.
lo);
145 return (hi > rhs.
hi) || (hi == rhs.
hi && lo > rhs.
lo);
150 return (hi > rhs.
hi) || (hi == rhs.
hi && lo >= rhs.
lo);
154 friend GEOS_DLL DD operator+ (
const DD &lhs,
double rhs);
156 friend GEOS_DLL DD operator- (
const DD &lhs,
double rhs);
158 friend GEOS_DLL DD operator* (
const DD &lhs,
double rhs);
160 friend GEOS_DLL DD operator/ (
const DD &lhs,
double rhs);
162 static DD determinant(
const DD &x1,
const DD &y1,
const DD &x2,
const DD &y2);
163 static DD determinant(
double x1,
double y1,
double x2,
double y2);
164 static DD abs(
const DD &d);
165 static DD pow(
const DD &d,
int exp);
166 static DD trunc(
const DD &d);
169 bool isNegative()
const;
170 bool isPositive()
const;
172 double doubleValue()
const;
174 int intValue()
const;
176 DD reciprocal()
const;
180 void selfAdd(
const DD &d);
181 void selfAdd(
double p_hi,
double p_lo);
182 void selfAdd(
double y);
184 void selfSubtract(
const DD &d);
185 void selfSubtract(
double p_hi,
double p_lo);
186 void selfSubtract(
double y);
188 void selfMultiply(
double p_hi,
double p_lo);
189 void selfMultiply(
const DD &d);
190 void selfMultiply(
double y);
192 void selfDivide(
double p_hi,
double p_lo);
193 void selfDivide(
const DD &d);
194 void selfDivide(
double y);
202 #endif // GEOS_MATH_DD_H bool operator>=(const DD &rhs) const
Wrapper for DoubleDouble higher precision mathematics operations.
bool operator>(const DD &rhs) const
bool operator==(const DD &rhs) const
bool operator!=(const DD &rhs) const
Basic namespace for all GEOS functionalities.
bool operator<=(const DD &rhs) const
bool operator<(const DD &rhs) const
DD(double p_hi, double p_lo)