16 bit float components and conversion 更多...
#include <Float16.h>
Public 成员函数 | |
| FFloat16 () | |
| Default constructor | |
| FFloat16 (const FFloat16 &FP16Value) | |
| Copy constructor. | |
| FFloat16 (float FP32Value) | |
| Conversion constructor. 更多... | |
| float | GetFloat () const |
| Convert from Fp16 to Fp32. | |
| operator float () const | |
| Convert from Fp16 to Fp32. | |
| FFloat16 & | operator= (const FFloat16 &FP16Value) |
| Assignment operator. 更多... | |
| FFloat16 & | operator= (float FP32Value) |
| Assignment operator. 更多... | |
| void | Set (float FP32Value) |
| Convert from Fp32 to Fp16. | |
| void | SetWithoutBoundsChecks (const float FP32Value) |
| Convert from Fp32 to Fp16 without doing any checks if the Fp32 exponent is too large or too small. 更多... | |
友元 | |
| FArchive & | operator<< (FArchive &Ar, FFloat16 &V) |
| Serializes the FFloat16. 更多... | |
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
| FORCEINLINE FFloat16::FFloat16 | ( | float | FP32Value | ) |
Conversion constructor.
Convert from Fp32 to Fp16.
Assignment operator.
Copy Fp16 value.
| FORCEINLINE FFloat16 & FFloat16::operator= | ( | float | FP32Value | ) |
Assignment operator.
Convert from Fp32 to Fp16.
| FORCEINLINE void FFloat16::SetWithoutBoundsChecks | ( | const float | FP32Value | ) |
Convert from Fp32 to Fp16 without doing any checks if the Fp32 exponent is too large or too small.
This is a faster alternative to Set() when you know the values within the single precision float don't need the checks.
| FP32Value | Single precision float to be set as half precision. |