The Lab
Retro Reference

C64 Floating Point

Convert a number to and from the Commodore 64's five-byte float, the format the BASIC ROM keeps in FAC and ARG. Edit either field.
Byte 0 is the exponent, biased by +129 (a zero byte means the value is exactly 0). The sign lives in bit 7 of byte 1, replacing the mantissa's always-1 leading bit; bytes 1–4 hold the 32-bit mantissa. So value = ±(1.mantissa) × 2(exp−129). Example: 1.0 is $81 $00 $00 $00 $00, π is $82 $49 $0F $DA $A1.