Lines Matching defs:DiyFp
167 // DiyFp is a floating-point number type, consists of a uint64 significand and one integer exponent.
168 struct DiyFp {
169 DiyFp() : f(), e() {}
170 DiyFp(uint64_t fp, int exp) : f(fp), e(exp) {}
172 explicit DiyFp(double d)
190 DiyFp operator - (const DiyFp &rhs) const
192 return DiyFp(f - rhs.f, e);
195 DiyFp operator*(const DiyFp &rhs) const
208 return DiyFp(ac + (ad >> kInt32Bits) + (bc >> kInt32Bits) + (tmp >> kInt32Bits), e + rhs.e + kInt64Bits);
211 DiyFp Normalize() const
213 DiyFp res = *this;
223 DiyFp NormalizeBoundary() const
225 DiyFp res = *this;
235 void NormalizedBoundaries(DiyFp *minus, DiyFp *plus) const
237 DiyFp pl = DiyFp((f << 1) + 1, e - 1).NormalizeBoundary();
238 DiyFp mi = (f == kDpHiddenBit) ? DiyFp((f << 2) - 1, e - 2) : DiyFp((f << 1) - 1, e - 1); // 2: parameter
265 static DiyFp GetCachedPower(int e, int *K)
278 static DiyFp GetCachedPowerByIndex(size_t index);
281 static void DigitGen(const DiyFp& W, const DiyFp& Mp, uint64_t delta, char* buffer, int* len, int* K);