0

Informally, it appears AVR-GCC is IEEE 754 compliant.

In this environment, how do I verify at compile time that floats are indeed IEEE 754 compliant? Much searching yields informative but inconclusive data

__STDC_IEC_559__ and friends return 0 even when runtime tests indicate floats are indeed compliant. std::numeric_limits is unavailable.

4
  • 1
    A sec. __STDC_IEC_559__ means conformance with some annex F in the C standard library, not that "floats are IEEE 754 compliant". What makes "floats" being IEEE 754 compliant? How much compliance are you searching for? There are levels gcc.gnu.org/wiki/FloatingPointMath . I would suspect there are no floating point exceptions on avr. yields informative but inconclusive data The answer you linked states "the floating-point format is: IEEE-754, binary, little-endian.". Is this inconclusive? Commented Mar 20, 2024 at 16:21
  • I'm working with someone who is implementing the dragonbox algorithm. I call this inconclusive because something feels wrong about looking for __AVR__ flag and calling it a day.. Thank you for your link, because that's the kind of thing I am looking for Commented Mar 20, 2024 at 16:51
  • If you think it is inconclusive, you could defined a floating point variable, print out the hexdecimal values pointed to the floating variable and verify it with online IEEE-754 PF conversion tool. Commented Mar 21, 2024 at 12:00
  • Let's not fall trap to equivocation. Inconclusive in this context means the lack of compiler-time proof that the compiler in its current state conforms to IEEE 754 Commented Mar 21, 2024 at 15:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.