109 static constexpr double SPLIT = 134217729.0;
118 DD(
double p_hi,
double p_lo) : hi(p_hi), lo(p_lo) {};
119 DD(
double x) : hi(x), lo(0.0) {};
120 DD() : hi(0.0), lo(0.0) {};
122 bool operator==(
const DD &rhs)
const
124 return hi == rhs.hi && lo == rhs.lo;
127 bool operator!=(
const DD &rhs)
const
129 return hi != rhs.hi || lo != rhs.lo;
132 bool operator<(
const DD &rhs)
const
134 return (hi < rhs.hi) || (hi == rhs.hi && lo < rhs.lo);
137 bool operator<=(
const DD &rhs)
const
139 return (hi < rhs.hi) || (hi == rhs.hi && lo <= rhs.lo);
142 bool operator>(
const DD &rhs)
const
144 return (hi > rhs.hi) || (hi == rhs.hi && lo > rhs.lo);
147 bool operator>=(
const DD &rhs)
const
149 return (hi > rhs.hi) || (hi == rhs.hi && lo >= rhs.lo);
152 friend GEOS_DLL
DD operator+ (
const DD &lhs,
const DD &rhs);
153 friend GEOS_DLL
DD operator+ (
const DD &lhs,
double rhs);
154 friend GEOS_DLL
DD operator- (
const DD &lhs,
const DD &rhs);
155 friend GEOS_DLL
DD operator- (
const DD &lhs,
double rhs);
156 friend GEOS_DLL
DD operator* (
const DD &lhs,
const DD &rhs);
157 friend GEOS_DLL
DD operator* (
const DD &lhs,
double rhs);
158 friend GEOS_DLL
DD operator/ (
const DD &lhs,
const DD &rhs);
159 friend GEOS_DLL
DD operator/ (
const DD &lhs,
double rhs);
161 static DD determinant(
const DD &x1,
const DD &y1,
const DD &x2,
const DD &y2);
162 static DD determinant(
double x1,
double y1,
double x2,
double y2);
163 static DD abs(
const DD &d);
164 static DD pow(
const DD &d,
int exp);
165 static DD trunc(
const DD &d);
168 bool isNegative()
const;
169 bool isPositive()
const;
171 double doubleValue()
const;
172 double ToDouble()
const {
return doubleValue(); }
173 int intValue()
const;
175 DD reciprocal()
const;
179 void selfAdd(
const DD &d);
180 void selfAdd(
double p_hi,
double p_lo);
181 void selfAdd(
double y);
183 void selfSubtract(
const DD &d);
184 void selfSubtract(
double p_hi,
double p_lo);
185 void selfSubtract(
double y);
187 void selfMultiply(
double p_hi,
double p_lo);
188 void selfMultiply(
const DD &d);
189 void selfMultiply(
double y);
191 void selfDivide(
double p_hi,
double p_lo);
192 void selfDivide(
const DD &d);
193 void selfDivide(
double y);
Wrapper for DoubleDouble higher precision mathematics operations.
Definition: DD.h:107
Basic namespace for all GEOS functionalities.
Definition: geos.h:39