Navigation
API > API/Runtime > API/Runtime/CorePreciseFP
Encapsulates a Verse float, which has a few deviations from IEEE-754 semantics for the sake of providing extensional equality; i.e. that iff two values compare as equal, there's no way to distinguish them.
IEEE-754 floats don't have extensional equality for two reasons:
- Zeroes of opposite signs compare as equal, but when used as a divisor produce different infinities.
- NaNs compare as unequal to themselves. We resolve this by defining division by negative zero to produce positive infinity, and collapsing NaNs to a single canonical NaN that compares as equal to itself and unordered with all numbers.
| Name | VFloat |
| Type | struct |
| Header File | /Engine/Source/Runtime/CorePreciseFP/Public/VerseVM/VVMFloat.h |
| Include Path | #include "VerseVM/VVMFloat.h" |
Syntax
struct VFloat
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
constexpr VFloat () |
Default initialize to zero. | VerseVM/VVMFloat.h | |
VFloat
(
double InValue |
VerseVM/VVMFloat.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Value | double | VerseVM/VVMFloat.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
double AsDouble() |
VerseVM/VVMFloat.h | ||
bool IsFinite() |
Predicates for different FP specials. | VerseVM/VVMFloat.h | |
bool IsInfinite() |
VerseVM/VVMFloat.h | ||
bool IsNaN() |
VerseVM/VVMFloat.h | ||
VFloat Purify() |
Purify a potentially impure float (as defined by VValue). | VerseVM/VVMFloat.h | |
int64 Ranking () |
Ranking function that turns a double into an int64 that defines a total order compatible with the ordering implied for floats, to be precise | VerseVM/VVMFloat.h | |
uint64 ReinterpretAsUInt64() |
VerseVM/VVMFloat.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static VFloat Infinity() |
VerseVM/VVMFloat.h | ||
static VFloat NaN() |
VerseVM/VVMFloat.h |