A float whose exponent is four trits
You will learn
How TNF17e packs a sign, a ternary exponent and a mantissa into 17 bits, and why 17 and not 16.
The name TNF covers two different things. In the sieve, TNF(k, b) is an alphabet of weights with 3 or 9 levels. TNF17e in tnf17.t27 is a Ternary Network Float, which the spec calls the signed accumulator format: a sign bit, a 7-bit offset and a 9-bit mantissa, worth (-1)^s x (1 + m/512) x 2^(offset - 40). Its trits are in the exponent, not in the weights: the offset takes 81 values, exactly 3^4, so the exponent is four balanced trits, from -40 to +40. Four trits cost 7 bits on a binary chip, so the rung is 17 bits, not 16; the spec records that its source counted positions, and a trit is not a bit. The browser runs 20 of its 44 checks, all 10 invariants among them, and names the cast behind each skip.