Flutter Engine
The Flutter Engine
|
#include <SkFloatUtils.h>
Public Types | |
typedef SkTypeWithSize< sizeof(RawType) *CHAR_BIT >::UInt | Bits |
Public Member Functions | |
SkFloatingPoint (const RawType &x) | |
Bits | exponent_bits () const |
Bits | fraction_bits () const |
bool | is_nan () const |
bool | AlmostEquals (const SkFloatingPoint &rhs) const |
Static Public Attributes | |
static const size_t | kBitCount = CHAR_BIT * sizeof(RawType) |
static const size_t | kFractionBitCount = SkNumericLimits<RawType>::digits - 1 |
static const size_t | kExponentBitCount = kBitCount - 1 - kFractionBitCount |
static const Bits | kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1) |
static const Bits | kFractionBitMask |
static const Bits | kExponentBitMask = ~(kSignBitMask | kFractionBitMask) |
static const size_t | kMaxUlps = ULPs |
Definition at line 55 of file SkFloatUtils.h.
typedef SkTypeWithSize<sizeof(RawType)*CHAR_BIT>::UInt SkFloatingPoint< RawType, ULPs >::Bits |
Bits is a unsigned integer the same size as the floating point number.
Definition at line 58 of file SkFloatUtils.h.
|
inlineexplicit |
Constructs a FloatingPoint from a raw floating-point number.
On an Intel CPU, passing a non-normalized NAN (Not a Number) around may change its bits, although the new value is guaranteed to be also a NAN. Therefore, don't expect this constructor to preserve the bits in x when x is a NAN.
Definition at line 90 of file SkFloatUtils.h.
|
inline |
Returns true iff this number is at most kMaxUlps ULP's away from ths. In particular, this function:
Definition at line 113 of file SkFloatUtils.h.
|
inline |
|
inline |
|
inline |
Returns true iff this is NAN (not a number).
Definition at line 99 of file SkFloatUtils.h.
|
static |
Definition at line 61 of file SkFloatUtils.h.
|
static |
Definition at line 67 of file SkFloatUtils.h.
|
static |
The mask for the exponent bits.
Definition at line 77 of file SkFloatUtils.h.
|
static |
Definition at line 64 of file SkFloatUtils.h.
|
static |
The mask for the fraction bits.
Definition at line 73 of file SkFloatUtils.h.
|
static |
How many ULP's (Units in the Last Place) to tolerate when comparing.
Definition at line 80 of file SkFloatUtils.h.
|
static |
The mask for the sign bit.
Definition at line 70 of file SkFloatUtils.h.