4 ms·
I don't think that's standards compliant. At least for floating-point, not entirely sure about pointers.
by mgaunard 4y ago
I don't think that's standards compliant.
At least for floating-point, not entirely sure about pointers.
- vmilner 4y agoYes. I was porting code to new machines and programmers had assumed it was compliant but it wasn’t.
- leni536 4y agofloats being IEEE compliant is optional by the language standards. Otherwise the bit representation is not specified.
- deleted 4y ago[deleted]
- mgaunard 4y agoIt still requires 0 to be represented as all bits set to zero.
- leni536 4y agoWhere does the ISO C standard say so? edit: https://cigix.me/c17#6.2.6.1.p1 https://cigix.me/c17#6.2.6.1.p1 seems relevant, I did not find anything for floating point types. edit2: Notes are probably not normative, but still: https://cigix.me/c17#footnote301 https://cigix.me/c17#footnote301
- vmilner 4y agoThat footnote confirms the traditional position that a floating point zero need NOT have an all-zero bit representation.