How big a number can each C type hold? We see how a type’s size sets its range: one byte gives 256 patterns, so a signed char holds -128 to 127 and an unsigned char holds 0 to 255. We go through the ranges of short, int, long and long long, signed and unsigned, and the ranges and precision of float and double. Then we open limits.h in Visual Studio 2026, print INT_MAX, UINT_MAX, LLONG_MAX, FLT_MAX and DBL_MAX in a program, and see what happens when a value goes past its range: unsigned types wrap around, and signed overflow is undefined behavior.
Chapters
00:00 Opening
00:03 Size Sets the Range
00:43 Where a Range Comes From
01:29 Ranges of the Integer Types
02:35 Pick a Type by Its Range
03:02 Floating-Point Ranges
03:33 Don’t Memorize, Look It Up
04:29 Printing the Limits
05:10 Going Past the Edge
05:45 Recap
📘 Lesson notes (PDF) + code for this episode:
Course repository:
Sources
C11 standard, 6.2.5p9 (unsigned arithmetic wraps) and 6.5p5 (overflow is undefined)
cppreference, Numeric limits:
cppreference, Arithmetic operators (overflows):
Part of the course: C Programming from Scratch
—
A Bit Clearer: code and hardware, made a bit clearer.
Music: “Sincerely” Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 4.0 License

📘 Notes for this episode (PDF) + code:
https://github.com/abitclearer/c-programming-from-scratch/tree/main/12-data-type-ranges
All episodes of C Programming from Scratch:
https://github.com/abitclearer/c-programming-from-scratch