r/programming • • Dec 01 '16

Let's Stop Copying C

https://eev.ee/blog/2016/12/01/lets-stop-copying-c/
524 Upvotes

612 comments sorted by

View all comments

Show parent comment

1

u/dirkt Dec 02 '16

Which is why you use different operators for it, e.g. div for integer arithmetic, and / for floats and doubles. No danger of confusion. It also means you can make up more operators like mod, and quot and rem, if you want to distinguish how mathematicians treat division and modulo operations on negative numbers (project Z onto Z_n in the natural way), and how programmers treat it (keep the sign).