FloatRep rep = {value: 0};
assert(rep.fraction == 0);
assert(rep.exponent == 0);
assert(!rep.sign);
rep.value = 42;
assert(rep.fraction == 2621440);
assert(rep.exponent == 132);
assert(!rep.sign);
rep.value = 10;
assert(rep.fraction == 2097152);
assert(rep.exponent == 130);
FloatRep rep = {value: 1};
assert(rep.fraction == 0);
assert(rep.exponent == 127);
assert(!rep.sign);
rep.exponent = 126;
assert(rep.value == 0.5);
rep.exponent = 130;
assert(rep.value == 8);
FloatRep rep = {value: 1};
rep.value = -0.5;
assert(rep.fraction == 0);
assert(rep.exponent == 126);
assert(rep.sign);
rep.value = -1. / 3;
assert(rep.fraction == 2796203);
assert(rep.exponent == 125);
assert(rep.sign);
Allows manipulating the fraction, exponent, and sign parts of a float separately. The definition is: