Floating-point from the bits up
Read the bits of a C float, then work up to predicting what x86 instructions
do with those bits.
Start here
Encode and decode a normal binary32 value by hand. Check your work against the bytes a C program reads.
Course roadmap
The next proposed lesson classifies signed zeros, subnormals, infinities, and NaNs. From there, the course covers rounding and arithmetic, decimal formats, obscure operations, and reproducibility on x86. It ends with a binary32 adder in C tested against a reference implementation.
Read the lesson sequence and clause-by-clause IEEE 754 coverage
Fixed-point and BCD in C
Choose a scale for a bounded range, decide how to handle overflow, and decode decimal digits from hardware or record formats. Start after Lesson 1 if you want to compare fixed and floating binary points.
- Decimal-scaled integers. Add prices stored as cents and check for signed overflow.
- Binary fixed-point multiplication. Multiply in a wider type, restore the binary scale, and reject out-of-range results.
- Saturating Q31 arithmetic. Clip a sample to fit and compare the explicit C implementation with compiler-provided types.
- Packed binary-coded decimal. Write a codec and read examples from current clock chips, COBOL records, and the PC/AT BIOS. Trace the native x86 decimal instructions and compare when to use BCD, fixed-point, and floating-point.