Variable view handing floating point types differently than expected [message #1842124] |
Wed, 09 June 2021 16:25 |
Anton Krug Messages: 9 Registered: August 2017 |
Junior Member |
|
|
When using hex (bin and octal) formatting on floating-point variables the view doesn't represent the variable in a way I would expect.
Currently, it casts the float to an int and then displays its hex value, so 3.14f will become a 0x3, while I would expect instead its IEEE754 representation which is 0x4048f5c3 like here:
https://www.h-schmidt.net/FloatConverter/IEEE754.html
See the attachment where there are C and H files that replicate the issue. And show my current workaround as well. I make a pointer to the float, cast that pointer to an int pointer and then dereference it.
In the screenshot, I invoked the function with 3.14f argument.
|
|
|
Powered by
FUDForum. Page generated in 0.02902 seconds