8

Division and Modulus for Computer Scientists

 3 years ago
source link: https://www.microsoft.com/en-us/research/publication/division-and-modulus-for-computer-scientists/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Division and Modulus for Computer Scientists

July 2003

Short note about division definitions in programming languages

View Publication

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.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK