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.

IEEE 754 conformance

Other Parts Discussed in Thread: OMAP-L138

Hi,

I'm using CGT7.2.3 for the OMAP-L138 and have 2 questions:

1. Doesn't IEEE 754 define HUGE_VAL as infinity?  If so, why is HUGE_VAL for the OMAP-L138 defined as DBL_MAX (1.7976931348623157E+308)?  Is there another way to generate infinity on the OMAP-L138 DSP?

2. Doesn't IEEE 754 support denormal numbers?  If so, why does the following code:

FLT my_diff = 1.12e-37 - 1.13e-37

produce the following warning:

warning #223-D: floating-point value does not fit in required floating-point type

and result in my_diff = 0 instead of -1.00000022e-39?

Thanks,

Will

P.S. My reference is: http://download.oracle.com/docs/cd/E19957-01/806-3568/ncg_goldberg.html

 

  • The short answer is that the TI C/C++ compiler does not support all aspects of IEEE-754, and isn't technically required to.

    In particular, the TI compiler does not completely support Inf and NaN, and doesn't support denormal numbers at all.  Some TI compilers, such as the upcoming compiler releases for ARM and MSP430, have better Inf and NaN support, but still not complete support.

    We would, of course, prefer to completely support IEEE-754, but other features and fixes take priority.

    The relevant standard here is the C standard ISO/IEC 9899:1990, of which the compiler supports the 1989 version (C89), which doesn't place many requirements on the floating-point support.  In particular, the representation might not even be IEEE-754 format (although it is for all of our current compilers).  The 1999 version (C99) has many more requirements for floating-point supports, but still full IEEE-754 support is optional.

    Both C89 and C99 say that HUGE_VAL may be implemented as an infinite value, but do not require this.

    See also http://processors.wiki.ti.com/index.php/TI_Compilers_and_Industry_Standards#IEEE_754

     

     

  • Thanks for the informative response; that all makes sense.