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 a const floating point with an raw binary value

Hello,

is there a way to initialize a floating point constant (code memory) with a raw binary value? Because we use a few special NAN flags and I cant initialize them using the CX51 compilier. With the IAR compilier I used a union and specified if the value should be interpreted as integer or floating point but with the CX51 compilier this is not possible for constant values because the compilier does not support this kind of initialization. It is part of C99 Standard but CX51 is C90. Maybe there is another way to do this.

Best regards

Parents
  • Hello,

    thanks for the answer. I know this is not the cleanest way but save me a lot of memory. I have my own NaN handling algorithm and check for NaN before I interact with library functions. Unfortunately I have to initialize both float and integer, so this is not a solution for me. Maybe there is another way?

Reply
  • Hello,

    thanks for the answer. I know this is not the cleanest way but save me a lot of memory. I have my own NaN handling algorithm and check for NaN before I interact with library functions. Unfortunately I have to initialize both float and integer, so this is not a solution for me. Maybe there is another way?

Children