Part 1
Chapter 1: The Hundred-Million-Dollar Bit--–- On February 4, 1996, the maiden flight of the Ariane 5 rocket ended in a fireball that cost the European Space Agency $370 million. The cause? Not a faulty booster, not a navigation error, not a terrorist attack. The cause was a single number that was too large to fit into a box.The rocket’s inertial navigation system attempted to convert a 64-bit floating-point number into a 16-bit signed integer. The value was too big—it exceeded the maximum representable number by a small margin. The conversion triggered an overflow exception. The software, believing this error indicated a catastrophic hardware failure, shut down the active guidance system.
A backup system, running the same flawed code, shut down 50 milliseconds later. The rocket, now flying blind, veered off course and self-destructed.Four hundred and seventy million dollars. Wasted. Because someone didn’t understand how computers represent numbers.You are about to learn why that happened. More importantly, you are about to learn how to never let it happen to you.The Great Analogy LieBefore we write a single line of code or flip a single logic gate, we need to confront a lie you have been told your entire life. The lie is this: computers work with the same numbers you learned in elementary school.In mathematics, the number 42 is infinite.
It exists perfectly and abstractly. You can add 42 to 42 forever and never run out of 42. You can divide 42 by 3 and get exactly 14. You can take the square root of 42 and get an irrational number that extends to infinity—but mathematically, that infinite decimal is still exactly the square root of 42.Computers cannot do any of this. Not really.A computer has a finite number of transistors. Those transistors can be on or off—1 or 0. That’s it. Every number, every letter, every pixel on your screen, every sound in your headphones, every frame of every movie you have ever streamed is represented by a finite sequence of these 1s and 0s.This chapter is about the bridge between the infinite world of mathematics and the brutally finite world of transistors.