Ark Server API (ASA) - Wiki
|
#include <Float16.h>
Public Member Functions | |
FFloat16 () | |
FFloat16 (const FFloat16 &FP16Value) | |
FFloat16 (float FP32Value) | |
FFloat16 & | operator= (float FP32Value) |
FFloat16 & | operator= (const FFloat16 &FP16Value) |
operator float () const | |
void | Set (float FP32Value) |
void | SetClamped (float FP32Value) |
void | SetTruncate (float FP32Value) |
void | SetZero () |
void | SetOne () |
FFloat16 | GetClampedNonNegativeAndFinite () const |
FFloat16 | GetClampedFinite () const |
float | GetFloat () const |
bool | IsNegative () const |
Public Attributes | |
uint16 | Encoded |
Static Public Attributes | |
static constexpr float | MaxF16Float = 65504.f |
Friends | |
FArchive & | operator<< (FArchive &Ar, FFloat16 &V) |
16 bit float components and conversion
IEEE float 16 Represented by 10-bit mantissa M, 5-bit exponent E, and 1-bit sign S
Specials:
E=0, M=0 == 0.0 E=0, M!=0 == Denormalized value (M / 2^10) * 2^-14 0<E<31, M=any == (1 + M / 2^10) * 2^(E-15) E=31, M=0 == Infinity E=31, M!=0 == NAN
conversion from 32 bit float is with RTNE (round to nearest even)
Legacy code truncated in the conversion. SetTruncate can be used for backwards compatibility.
FORCEINLINE FFloat16::FFloat16 | ( | ) |
FORCEINLINE FFloat16::FFloat16 | ( | const FFloat16 & | FP16Value | ) |
FORCEINLINE FFloat16::FFloat16 | ( | float | FP32Value | ) |
FORCEINLINE FFloat16 FFloat16::GetClampedFinite | ( | ) | const |
FORCEINLINE FFloat16 FFloat16::GetClampedNonNegativeAndFinite | ( | ) | const |
FORCEINLINE float FFloat16::GetFloat | ( | ) | const |
|
inline |
FORCEINLINE FFloat16::operator float | ( | ) | const |
FORCEINLINE FFloat16 & FFloat16::operator= | ( | const FFloat16 & | FP16Value | ) |
FORCEINLINE FFloat16 & FFloat16::operator= | ( | float | FP32Value | ) |
FORCEINLINE void FFloat16::Set | ( | float | FP32Value | ) |
FORCEINLINE void FFloat16::SetTruncate | ( | float | FP32Value | ) |