Hello,
how can I achieve
long l = WHAT_EVER_MACRO (-12.5); main() { printf("%X",l); }
resulting in output "0xC1480000" the binary representation of the float -12.5 . Without that MACRO the value is 0xFFFFFFF4 = -12 for integers .
Because of given circumstances in an existing project I have to store float values during initialization in long variables.
Is there any possibility?
Thanks in advance
Jürgen
It's only if you have stored the float into memory that you could then take the address of the variable and typecast into a pointer to long.
While just being a numeric constant, it doesn't have any storage format so it obviously doesn't have any binary pattern.