Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

Q format

The name of a fixed-point number's scale, such as Q15 (value × 32 768) or Q8.8 (value × 256).

Qm.n notation gives a fixed-point format's m integer bits and n fraction bits (sign bit counted separately here); Q15 stores values from -1 to 1 - 2^-15 in an int16_t, Q8.8 values from -128 to about 127.996 in steps of 1/256.

Examples

  • In Q8.8 a greenhouse reading of 18.75 °C is stored as 4800, and each step is 1/256 °C.

  • Q15 stores 0.25 as 8192 but can't hold 1.0 exactly: its largest value, 32 767, is just under.

Read the full section →