The Maths You Actually NeedLesson 67 of 76

Module 8 · Numbers inside a machine

What a float32 actually stores, and where its seven digits run out

In this lesson

  • 10 min read
  • 7 reading sections
  • Knowledge check
  • Lesson 1 of 10 in this chapter

This chapter’s goalPredict from the bit layout of float32, fp16 and bf16 which computation will overflow, underflow or lose its digits, explain why a long sum drifts and how to fix it, quantise a weight to int8 by hand and say what an outlier does to the rest of the tensor, derive the initialisation scale that keeps variance constant through a layer, and diagnose a NaN in training back to the operation that produced it.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available
The 32 bits of a float32, and what each field costs youSign, 1 bitpositive or negativeExponent, 8 bitsrange about ten to the plus or minus 38; expoverflows at 88.7Mantissa, 23 bits stored and 24 used7.2 decimal digits: the gap at 1 is 0.00000012, at16.8 million it is 2Every surprise in this module comes from those three widths. Seven digits is why a variance computedby subtraction fails; the growing gap is why a float32 counter stalls at 16,777,216 and why adding 1to a hundred million does nothing at all.
Every surprise in this module comes from those three widths. Seven digits is why a variance computed by subtraction fails; the growing gap is why a float32 counter stalls at 16,777,216 and why adding 1 to a hundred million does nothing at all.

Figure 8.1

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 8Free · no account needed
Lesson steps

Thirty-two bits, three fields

A float32 is scientific notation in binary. Its 32 bits are split into a sign (1 bit), an exponent (8 bits) and a fraction called the mantissa (23 bits):

Text
value = (−1)^sign × 1.mantissa × 2^(exponent − 127)

The leading 1 is not stored, because in binary the first significant digit is always 1, so the mantissa carries 24 bits of precision for the price of 23. Everything about how floats behave follows from those three field widths.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Stuck on something?Ask Funke, your AI tutor

How to cite: Addaly (2026) ‘What a float32 actually stores, and where its seven digits run out’, in The Maths You Actually Need. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/maths-you-need/floating-point-anatomy (Accessed: 29 November 2026).