53 explicit Double(uint64_t d64) : d64_(d64) {}
55 : d64_(DiyFpToUint64(diy_fp)) {}
89 if (d64_ == kInfinity)
return Double(kInfinity).value();
95 return Double(d64_ - 1).value();
97 return Double(d64_ + 1).value();
107 return biased_e - kExponentBias;
161 if (significand_is_zero && v.
e() != kDenormalExponent) {
168 m_minus =
DiyFp((v.
f() << 2) - 1, v.
e() - 2);
170 m_minus =
DiyFp((v.
f() << 1) - 1, v.
e() - 1);
172 m_minus.
set_f(m_minus.
f() << (m_minus.
e() - m_plus.
e()));
173 m_minus.
set_e(m_plus.
e());
174 *out_m_plus = m_plus;
175 *out_m_minus = m_minus;
190 if (order <= kDenormalExponent)
return 0;
191 return order - kDenormalExponent;
196 static const int kDenormalExponent = -kExponentBias + 1;
197 static const int kMaxExponent = 0x7FF - kExponentBias;
202 static uint64_t DiyFpToUint64(
DiyFp diy_fp) {
203 uint64_t significand = diy_fp.
f();
204 int exponent = diy_fp.
e();
209 if (exponent >= kMaxExponent) {
212 if (exponent < kDenormalExponent) {
215 while (exponent > kDenormalExponent && (significand &
kHiddenBit) == 0) {
219 uint64_t biased_exponent;
220 if (exponent == kDenormalExponent && (significand & kHiddenBit) == 0) {
223 biased_exponent =
static_cast<uint64_t
>(exponent + kExponentBias);
232 #endif // V8_DOUBLE_H_
uint64_t Significand() const
double NextDouble() const
static const uint64_t kExponentMask
static const int kSignificandSize
uint64_t double_to_uint64(double d)
void set_f(uint64_t new_value)
DiyFp UpperBoundary() const
static const uint64_t kHiddenBit
static int SignificandSizeForOrderOfMagnitude(int order)
#define ASSERT(condition)
static const int kSignificandSize
static const uint64_t kSignMask
double uint64_to_double(uint64_t d64)
#define V8_2PART_UINT64_C(a, b)
DiyFp AsNormalizedDiyFp() const
static const uint64_t kSignificandMask
uint64_t AsUint64() const
void set_e(int new_value)
void NormalizedBoundaries(DiyFp *out_m_minus, DiyFp *out_m_plus) const
static const int kPhysicalSignificandSize