S
Skarmander
This:
#include <stdint.h>
union r_float {
float f;
uint32_t i;
};
/* .. */
float f;
uint32_t i;
union r_float ra;
/* .. */
ra.f = f;
i = ra.i;
depends only on implementation-defined aspects, right? That is, if I know
uint32_t exists and the sizes of the objects are identical, will 'i' and 'f'
have identical bit patterns after the assignments? Similarly, will the same
hold for:
ra.i = i;
f = ra.f;
if I know the bit pattern of 'i' is not a trap representation for 'float'?
S.
#include <stdint.h>
union r_float {
float f;
uint32_t i;
};
/* .. */
float f;
uint32_t i;
union r_float ra;
/* .. */
ra.f = f;
i = ra.i;
depends only on implementation-defined aspects, right? That is, if I know
uint32_t exists and the sizes of the objects are identical, will 'i' and 'f'
have identical bit patterns after the assignments? Similarly, will the same
hold for:
ra.i = i;
f = ra.f;
if I know the bit pattern of 'i' is not a trap representation for 'float'?
S.