This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Initialize long with floats binary representation

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

0