Division and Modulus for Computer Scientists

There exist many definitions of the div and mod functions in computer science literature and programming languages. We briefly review the most common definitions (truncated division, Knuth's floored division, etc.) and discuss the rare, but mathematically elegant, Euclidean division. We also give an algorithm for the Euclidean div and mod functions and prove it correct with respect to Euclid's theorem.

divmodnote.pdf
PDF file
divmodnote-letter.pdf
PDF file

Details

TypeMiscellaneous
Book titleShort note about division definitions in programming languages
Share
Share this page on Facebook
Share this page on Twitter
Share this page on LinkedIn
E-mail this page
RSS feeds
> Publications > Division and Modulus for Computer Scientists