Multiplication Memes

Posts tagged with Multiplication

Egypt Binary

Egypt Binary
Ancient Egyptians apparently invented a multiplication algorithm that works by repeatedly doubling and halving numbers, then adding only the rows where the halved number is odd. So 13 × 24 becomes a series of doubles (24, 48, 96, 192) while halving 13 down (6, 3, 1), then you cross out rows with even numbers and add what's left: 24 + 96 + 192 = 312. It's basically binary multiplication disguised as ancient wisdom. The pharaoh smugly declaring "IT'S VERY SIMPLE!" while modern programmers realize they've been doing bit-shifting operations the whole time without the cool historical context. Turns out the Egyptians were doing bitwise operations before computers existed. They just didn't have Stack Overflow to copy-paste from.

Most Complicated Way To Do Something Simple

Most Complicated Way To Do Something Simple
When you need to reverse a number's sign but decide to take the scenic route through Absurdistan... This function is the programming equivalent of using a nuclear submarine to cross a puddle. The code checks if d is negative, then uses Abs() to make it positive (reasonable). But if it's positive? It subtracts d*2 from itself—a galaxy-brain approach to multiplication by -1. What makes this truly horrifying is that this overcomplicated monstrosity was part of the UK Post Office's Horizon system that led to the wrongful prosecution of hundreds of postal workers. Real people went to jail because someone couldn't write d = -d . The tragic irony? The comment literally shows the correct solution right above the function. It's like putting "just use stairs" in the elevator manual, then designing a catapult instead.