GF12: twelve bits

You will learn

The twelve-bit GoldenFloat, 1 + 4 + 7, bias 7, and how a test name can promise more than its assert.

gf12.t27 holds 12 bits: 1 sign, 4 exponent, 7 mantissa bits, and bias 7. Its ratio E / M is 4 / 7 = 0.571, and PHI_DISTANCE is 0.0466. The test that checks it is named gf12_phi_distance_lowest, but it asserts only that the distance is under 0.05, and a comment in the spec calls GF12 the closest of all formats. The family says otherwise: GF14 in the next lesson sits 0.007 from 1 / phi, and GF32 0.0135. Read a test by its assert, not by its name. MEMORY_RATIO_VS_FP32 is 12 / 32 = 0.375.

Open the interactive lesson →