Union to create float values with integer constants. More...
Public Member Functions | |
operator float () const noexcept | |
Accessor to load the floating point value. | |
uint32_float_t & | operator= (float fInput) noexcept |
Update with a new floating point value. | |
float | get_float (void) const noexcept |
Accessor to load the 32 float. | |
void | set_float (float fInput) noexcept |
Set the floating point value with a binary representation in a float. | |
uint32_t | get_uint32 (void) const noexcept |
Accessor to load the 32 bit value in binary. | |
void | set_uint32 (uint32_t uInput) noexcept |
Set the floating point value with a binary representation in an integer. | |
Public Attributes | |
uint32_t | w |
Value in binary. | |
float | f |
Value as a 32 bit float. | |
Union to create float values with integer constants.
Some "C" compilers are not 100% accurate in creating floating point constants. To get around this limitation, once the binary representation of a floating point number is determined, it will be used to assign the value so the binary representation does not change from compiler to compiler.
This union is also used to obtain the binary representation of a 32 bit float in a cross compiler way.
|
inlinenoexcept |
|
inlinenoexcept |
Accessor to load the 32 bit value in binary.
|
inlinenoexcept |
|
inlinenoexcept |
Update with a new floating point value.
fInput | 32 bit floating point number to store in the union |
|
inlinenoexcept |
Set the floating point value with a binary representation in a float.
fInput | 32 bit float to store in the union |
|
inlinenoexcept |
Set the floating point value with a binary representation in an integer.
uInput | 32 bit integer to store in the union |
float Burger::uint32_float_t::f |
Value as a 32 bit float.
uint32_t Burger::uint32_float_t::w |
Value in binary.