t27.aiРусский

Bits, trits and GF16

You will learn

How a number is stored in bits, and how balanced ternary stores it in trits.

Hardware stores numbers as fixed groups of bits, and t27 makes you write the width: u8 is 8 unsigned bits, i16 is 16 signed bits. t27 also speaks balanced ternary, where a trit is -1, 0 or +1. For fractions it has GF16, a 16-bit float with 1 sign bit, 6 exponent bits and 9 mantissa bits. Type a number into the calculator and watch how it is rounded, field by field, and how big the error is.

Try it

Type 1.618 and read the exponent and mantissa bits; then type 0.1 and look at the error.

Open the interactive lesson →

GF16 calculator: a number as 16 GoldenFloat bits and as ternary
GF16 calculator: a number as 16 GoldenFloat bits and as ternary ↗

Open the lesson's spec in the player: specs/tutorial/01_values_and_types.t27

All lessons