3 ms·
The Problem with Integer Division (2009)
- gpvos 11y agoInterestingly, in Perl 6, division results in rational numbers. I wonder whether (and if so, how) they avoid the slowdown Guido describes.
- cballard 11y agoWell, these types of problems don't exist in languages that correctly distinguish floating-point numbers and integers as two separate incompatible things. I think that this isn't really a problem with integer division (which is fine), but with not having a good type system. Even if Python allowed you to optionally declare the types of your arguments, and silently converted like C, this wouldn't be an issue.