there, of course, we have a real compiler and don't have to
write uvlong constants as floating point numbers
(wow that seems fragile).

Scarily: they're not:
if you read on, that macro is for picking apart a double into bytes and vice-versa.
(i.e. it's insanity is internally consistent).
It's still ludicrous and fragile.

As far as I can see,
they're assuming that double is IEEE 754 and that you can
rip apart such a representation on an random-endian machine
and re-assemble it on an any other random-endian machine.

Does C99 or any other C mandate the actual memory layout
of floats and doubles or the exact conversion of constant representations?
I'm fairly sure they somehow mandate IEEE 754 properties,
but do they actually say that floats and doubles have to be stored exactly that way in 4 or 8 bytes?

Even if we assume sizeof(double) == 8,
what if my implementation is perverse and interleaves the exponent bits amongst the mantissa bits?
Where is this disallowed in the standard(s)?

DaveL



Reply via email to