If __STDC_IEC_559__
is not defined, then how to determine at compile time that FP implementation of a (unknown in advance) C compiler (at least partially) conforms to IEEE 754
and not to other FP standard / document?
Asked
Active
Viewed 93 times
0

pmor
- 5,392
- 4
- 17
- 36
1 Answers
1
There is no other relevant standard. Either the implementation mostly conforms/attempts to conform to Annex F (thus IEEE 754) or it's sufficiently broken that you can't use it for floating point. So for practical purposes, if you want to do floating point, you just document a dependence on having working floating point to the extent you need, and treat compilers that don't provide that as unsupported. There's no alternative you need to detect and also support.

R.. GitHub STOP HELPING ICE
- 208,859
- 35
- 376
- 711
-
There is no other relevant standard(s) _yet_. When it / they will be and if all `__STDC_IEC_XXX__` are not defined, then how to determine at compile time which FP standard is actually used? – pmor Dec 07 '20 at 22:22
-
1There aren't and won't be. No reasonable implementor will ever replace the standard floating point types by unum or whatever the latest crackpottery is. If one did support them, they'd be extension types, with the standard floating point types being implemented as softfloat if not provided by the hardware. – R.. GitHub STOP HELPING ICE Dec 07 '20 at 22:36