Skip to content

algorithms

2 posts with the tag “algorithms”

The Long Division

An arbitrary-precision integer, and why division is the part everyone gets wrong.

Sixty-four bits runs out. A 256-bit hash, a base conversion, a counter that must never wrap, and suddenly you want a number with no ceiling that still reads like a * b + c. The sixth familiar is that number. Addition is easy and multiplication has a famous trick, but division is the operation that separates a bignum that works from one that is wrong on inputs no random test will ever find, and you will never know which.