← All treasure hunts

Floating Point Binary Treasure Hunt mantissa : exponent

Time: 00:00
Floating Point Reference — read this first

Every card states the next card's number as a floating point value — either as binary (mantissa + exponent) or as an exact decimal, chosen at random. The format is always given as mantissa bits : exponent bits (usually 8:4). Mantissa and exponent are both two's complement, the binary point sits after the first mantissa bit, and every number is normalised — a positive mantissa starts 0.1, a negative one starts 1.0. Nothing is ever rounded or truncated. Convert it to find the matching card on the wall (the wall switches between decimal and binary to match the answer you're working out).

Binary → Decimal

Mantissa place values: the first bit is worth −1, then ½, ¼, ⅛… The exponent is a two's complement whole number. Multiply the mantissa by 2exponent (i.e. move the binary point).
0.1101000 = ½+¼+⅝ = 0.8125; exponent 0011 = 3; 0.8125 × 23 = 6.5

Decimal → Binary

Write the number in binary, then move the binary point until it's normalised (0.1…). The number of places moved is the exponent. Pad the mantissa with zeros to the stated length.
6.5 = 110.1 = 0.1101 × 23 → mantissa 0.1101000, exponent 0011

Negative numbers

Do the positive version, then take the two's complement of the mantissa (invert, add 1). It must now start 1.0.
−6.5: 0.1101000 → invert 1.0010111 → +1 1.0011000, exponent 0011

Starting clue
—
—
Convert this to find the matching card on the wall below.

🏆 Treasure Found!

You correctly converted every floating point value in the chain.