Provides functionalities to encode floats into different formats.
More...
Provides functionalities to encode floats into different formats.
◆ floatToHalf()
static unsigned short nkMaths::FloatEncoder::floatToHalf |
( |
float |
v | ) |
|
|
static |
Allows to convert a 32bits floating point encoded value into a 16bits (half) floating point representation.
Half floats have 1 bit for sign, 5 bits for the exponent and 10 bits for the fractional part.
- Parameters
-
- Returns
- The half float equivalent, encoded in a short.
◆ halfToFloat()
static float nkMaths::FloatEncoder::halfToFloat |
( |
unsigned short |
v | ) |
|
|
static |
Allows to convert a 16bits (half) floating point encoded value into a 32bits floating point representation.
Floats have 1 bit for sign, 8 bits for the exponent and 23 bits for the fractional part.
- Parameters
-
v | The half float to convert. |
- Returns
- The float equivalent.
The documentation for this class was generated from the following file: