4 ms·
I like the Pascal way of using named operators like `div` (and `mod`, `xor`, `shr`, `shl`, `sar` etc.). Much easier to remember, read and type. Why does everyth
by 1wd 10y ago
I like the Pascal way of using named operators like `div` (and `mod`, `xor`, `shr`, `shl`, `sar` etc.). Much easier to remember, read and type. Why does everything have to be cryptic symbols?
This also frees up those symbols for use in more frequently used constructs. How often do you actually use those bit fiddling operators nowadays?
- AnimalMuppet 10y agoI want / for division for the same reason that I want + for addition. (Pascal doesn't make you say 'plus'...)
- 1wd 10y agoPascal has / for real division, but div for (truncated) integer division.
- AnimalMuppet 10y agoSo it had + for "integer addition, but can overflow", and what for "real" addition? My point is that separating "real" division from integer division is... a bit artificial? Not totally mistaken - there are differences - and yet calling one "real" is going a bit too far. All of these models of arithmetic suffer from the limitations of their representation. In all cases, you'd better be aware of what those limitations are...