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.

C2000-CGT: Open defect "C2000 RTS float arithmetic functions do not round correctly"

Part Number: C2000-CGT

There is a known open defect in CGT for C2000: https://sir.ext.ti.com/jira/browse/EXT_EP-7897

I'd like to see the details about this defect: which functions are affected? What problems this defect leads to? How can I test it? What workarounds should I use to bypass this defect?

Where can I get this information?

Regards,
Alex

  • This is a specific instance of the problem more generally described in the Quality of implementation part of the larger article on Floating Point Optimization.  One example is that the expression 1+DBL_EPSILON/2 should be rounded DOWN to 1.0, but some other result is seen.  I'm collecting more details.

    Thanks and regards,

    -George

  • A more specific expression of the problem is ...

    double result, a, b, c;
    
    a = 1.0;
    b = DBL_EPSILON; /* from <float.h> */
    c = 2.0;
    
    result = a + b/c;

    If your device supports floating point instructions, and thus you build with --float_support=fpu32 or --float_support=fpu64, then this floating point expression is implemented with hardware instructions, and the correct result of 1.0 is computed.  If your device does not support floating point instructions, and thus you do not build with --float_support, then this floating point expression is implemented by calling functions in the compiler RTS library, and the slightly incorrect result of 1.00000012 is computed.

    Thanks and regards,

    -George

  • Hi George,

    Is this the sole issue? I use F28379D microcontroller with hardware floating point support enabled  and some time ago I came across strange calculation results during couple of sin and cos calls. I managed to solve my problem by using some hacks but remembered this oddity and now try to collect any information that can explain those results.

    Regards,
    Alex

  • Is this the sole issue?

    No.  As I explained in my first reply, this a specific instance of a more general problem.

    Thanks and regards,

    -George