1 #ifndef __STDAIR_BAS_FLOAT_UTILS_GOOGLE_HPP 2 #define __STDAIR_BAS_FLOAT_UTILS_GOOGLE_HPP 53 template <
size_t size>
79 typedef unsigned __int64
UInt;
81 typedef long long Int;
82 typedef unsigned long long UInt;
83 #endif // GTEST_OS_WINDOWS 116 template <
typename RawType>
130 std::numeric_limits<RawType>::digits - 1;
215 return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
221 union FloatingPointUnion {
241 static Bits SignAndMagnitudeToBiased(
const Bits &sam) {
253 static Bits DistanceBetweenSignAndMagnitudeNumbers(
const Bits &sam1,
255 const Bits biased1 = SignAndMagnitudeToBiased(sam1);
256 const Bits biased2 = SignAndMagnitudeToBiased(sam2);
257 return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
260 FloatingPointUnion u_;
263 #endif // __STDAIR_BAS_FLOAT_UTILS_GOOGLE_HPP TypeWithSize< sizeof(RawType)>::UInt Bits
static const size_t kFractionBitCount
static const size_t kExponentBitCount
FloatingPoint(const RawType &x)
Bits fraction_bits() const
static const size_t kBitCount
static RawType Infinity()
static const size_t kMaxUlps
static const Bits kExponentBitMask
static const Bits kFractionBitMask
static const Bits kSignBitMask
bool AlmostEquals(const FloatingPoint &rhs) const
Bits exponent_bits() const
static RawType ReinterpretBits(const Bits bits)
const Bits & bits() const