This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/LAUNCHXL-F28069M: Reassociation of FP arithmetic

Part Number: LAUNCHXL-F28069M

Tool/software: TI C/C++ Compiler

Dear all

     Can anyone explain what "Allow reassociation of FP arithmetic" ON an OFF does? What is reassociated?

Thanks

Luis Gonçalves

  • x * 5.0 / 15.0 after reassociation will turn into x * 0.33333333..

    Since FP operations not very often give exact results, proper C compiler should never reassociate FP operations, it should first multiply by 5, then divide by 15. Even replacing /15 with *0.06666... is not allowed. But for better performance you may set this option to ON, of course if you don't mind side effects of reassociation.

    Edward
  • Luis,

    Hopefully this answers your question.

    Thanks EK for your help.

    - Ken