[Cfp-interest 2314] Flushed subnormals

Fred J. Tydeman tydeman at tybor.com
Wed Jan 12 12:54:05 PST 2022


More thoughts on:

>> Some opinions from stackoverflow.com say (since the C standard does not explicitly define the behaviour of flushed
>> subnormals), it is undefined behaviour (UB). Other opinions say treat them as another form of zero.

One idea:
The C standard does not define the behaviour of
  integer arithmetic
  non-decimal floating-point arithmetic
Does that make it UB?
Also, why are flushed subnormals special?

On the other hand, C does have in 5.2.4.2.2#8
The accuracy of the floating-point operations (+ ,- , * , / ) and of the library functions in <math.h>
and <complex.h> that return floating-point results is implementation-defined, as is the accuracy of
the conversion between floating-point internal representations and string representations performed
by the library functions in <stdio.h>, <stdlib.h>, and <wchar.h>. The implementation may state
that the accuracy is unknown. Decimal floating-point operations have stricter requirements.

So, the accuracy of FP operations with subnormals is implementation defined.

Aside: I do not see where the C standard has stricter accuracy requirements for decimal FP.
5.2.4.2.3#9 does have requirements on quantum exponents.

So, do we need the green part of http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2797.htm


---
Fred J. Tydeman        Tydeman Consulting
tydeman at tybor.com      Testing, numerics, programming
+1 (702) 608-6093      Vice-chair of PL22.11 (ANSI "C")
Sample C99+FPCE tests: http://www.tybor.com
Savers sleep well, investors eat well, spenders work forever.



More information about the Cfp-interest mailing list