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

double vs float ??

I am using float variable in my code, and I get an error because of exceeding the limit size of code. If I replace the float with double variale the code size reduces to 99% which is capable to execute.
I was expecting the opposite, because double holds 8 bytes and float 4 bytes. Any clues?

Note: I am using GNU 4.1.1

Parents Reply Children
  • according to what u say, means the code size should remain the same...which is not the case....

    Err ... no ?

    If you use float, then the compiler needs to insert extra code to convert float to double when calling math functions.

    If you use double to begin with, the compiler doesn't need to generate extra code when you call math functions.