Navigation
API > API/Runtime > API/Runtime/uLangCore > API/Runtime/uLangCore/CMath
Description
Ranking function that turns a double into an int64 that defines a total order compatible with the ordering implied for floats, to be precise
FloatLess(a,b) => FloatRanking(a) < FloatRanking(b) FloatEqual(a,b) <=> FloatRanking(a) == FloatRanking(b)
For FloatLess(a,b), we only have implication in one direction because when a single NaN is involved, the strict "less" ordering relationship is partial. In the total order implied by FloatRanking, NaN compares larger than all other floats. Unlike normal IEEE semantics, NaNs compare equal to each other in our ordering, so for FloatEqual we have full equivalence.
FloatRanking can be used directly or as a key for sorted maps and hashes.
| Name | FloatRanking |
| Type | function |
| Header File | /Engine/Source/Runtime/Solaris/uLangCore/Public/uLang/Common/Misc/MathUtils.h |
| Include Path | #include "uLang/Common/Misc/MathUtils.h" |
| Source | /Engine/Source/Runtime/Solaris/uLangCore/Private/uLang/Common/Misc/MathUtils.cpp |
static int64_t FloatRanking
(
double Value
)