Lines Matching defs:bits
6715 // For float, there are 8 exponent bits and 23 fraction bits.
6717 // For double, there are 11 exponent bits and 52 fraction bits.
6730 typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
6734 // # of bits in a number.
6737 // # of fraction bits in a number.
6741 // # of exponent bits in a number.
6745 static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
6747 // The mask for the fraction bits.
6748 static const Bits kFractionBitMask =
6749 ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
6751 // The mask for the exponent bits.
6752 static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
6762 // bits. Therefore, 4 should be enough for ordinary use.
6771 // around may change its bits, although the new value is guaranteed
6773 // preserve the bits in x when x is a NAN.
6781 static RawType ReinterpretBits(const Bits bits) {
6783 fp.u_.bits_ = bits;
6794 // Returns the bits that represents this number.
6795 const Bits &bits() const { return u_.bits_; }
6797 // Returns the exponent bits of this number.
6798 Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
6800 // Returns the fraction bits of this number.
6801 Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
6804 Bits sign_bit() const { return kSignBitMask & u_.bits_; }
6808 // It's a NAN if the exponent bits are all ones and the fraction
6809 // bits are not entirely zeros.
6832 Bits bits_; // The bits that represent the number.
6850 static Bits SignAndMagnitudeToBiased(const Bits &sam) {
6862 static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
6863 const Bits &sam2) {
6864 const Bits biased1 = SignAndMagnitudeToBiased(sam1);
6865 const Bits biased2 = SignAndMagnitudeToBiased(sam2);