3 ms·
It's a valid criticism: By the principle of least surprise, one should strive for a//b = int(a/b). Basically, there's no free lunch. Personally, I prefer trunc
by cygx 3y ago
It's a valid criticism: By the principle of least surprise, one should strive for a//b = int(a/b).
Basically, there's no free lunch. Personally, I prefer truncating integer division in combination with a pair of remainder operators.
- odyssey7 3y agoInspired by Monty Python, the surprises are part of the charm. ¯\_(ツ)_/¯