Home | History | Annotate | Download | only in internal

Lines Matching refs:Bits

309 //   For float, there are 8 exponent bits and 23 fraction bits.
311 // For double, there are 11 exponent bits and 52 fraction bits.
324 typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
328 // # of bits in a number.
331 // # of fraction bits in a number.
335 // # of exponent bits in a number.
339 static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
341 // The mask for the fraction bits.
342 static const Bits kFractionBitMask =
343 ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
345 // The mask for the exponent bits.
346 static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
356 // bits. Therefore, 4 should be enough for ordinary use.
365 // around may change its bits, although the new value is guaranteed
367 // preserve the bits in x when x is a NAN.
375 static RawType ReinterpretBits(const Bits bits) {
377 fp.bits_ = bits;
388 // Returns the bits that represents this number.
389 const Bits &bits() const { return bits_; }
391 // Returns the exponent bits of this number.
392 Bits exponent_bits() const { return kExponentBitMask & bits_; }
394 // Returns the fraction bits of this number.
395 Bits fraction_bits() const { return kFractionBitMask & bits_; }
398 Bits sign_bit() const { return kSignBitMask & bits_; }
402 // It's a NAN if the exponent bits are all ones and the fraction
403 // bits are not entirely zeros.
437 static Bits SignAndMagnitudeToBiased(const Bits &sam) {
449 static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
450 const Bits &sam2) {
451 const Bits biased1 = SignAndMagnitudeToBiased(sam1);
452 const Bits biased2 = SignAndMagnitudeToBiased(sam2);
458 Bits bits_; // The bits that represent the number.