3 ms·
This article when I first read it over a decade ago made me internalise the fact that “int” types are not mathematical integers but are instead rings. If you l
by jiggawatts 2y ago
This article when I first read it over a decade ago made me internalise the fact that “int” types are not mathematical integers but are instead rings.
If you look at every algorithm through that lens, interpreting them with the actual type instead of an idealised one, then bugs like this will jump out at you. (Similarly, compiler optimizer passes and the like all need to account for this.)