1 #ifndef __OPENTREP_BAS_FLOAT_UTILS_GOOGLE_HPP
2 #define __OPENTREP_BAS_FLOAT_UTILS_GOOGLE_HPP
59 template <
size_t size>
85 typedef unsigned __int64
UInt;
87 typedef long long Int;
88 typedef unsigned long long UInt;
89 #endif // GTEST_OS_WINDOWS
122 template <
typename RawType>
136 std::numeric_limits<RawType>::digits - 1;
221 return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
227 union FloatingPointUnion {
247 static Bits SignAndMagnitudeToBiased(
const Bits &sam) {
259 static Bits DistanceBetweenSignAndMagnitudeNumbers(
const Bits &sam1,
261 const Bits biased1 = SignAndMagnitudeToBiased(sam1);
262 const Bits biased2 = SignAndMagnitudeToBiased(sam2);
263 return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
266 FloatingPointUnion u_;
269 #endif // __OPENTREP_BAS_FLOAT_UTILS_GOOGLE_HPP
static const size_t kExponentBitCount
Bits exponent_bits() const
static RawType ReinterpretBits(const Bits bits)
static const Bits kSignBitMask
bool AlmostEquals(const FloatingPoint &rhs) const
Bits fraction_bits() const
TypeWithSize< sizeof(RawType)>::UInt Bits
static const Bits kExponentBitMask
static const size_t kBitCount
const Bits & bits() const
static const Bits kFractionBitMask
static const size_t kFractionBitCount
FloatingPoint(const RawType &x)
static const size_t kMaxUlps
static RawType Infinity()