What procedures does Scheme provide for doing arithmetic on integers?
First of all, it provides some basic arithmetic operations: addition, subtraction, multiplication, and division. There are procedures for computing absolute values and for finding the least or the greatest of any number of integers. Finally, there are procedures for finding the greatest common divisor (gcd) and least common multiple (lcm) of any number of integers. (The greatest common divisor of a collection of numbers is the greatest integer that evenly divides all of them; their least common multiple is the least positive integer that is evenly divisible by all of them.)
Here, then, is the list of integer procedures:
+ (addition)
- (subtraction, negative)
* (multiplication)
quotient (division)
remainder
modulo
abs (absolute value)
max (maximum value)
min (minimum value)
gcd (greatest common divisor))
lcm (least common multiple)
Next topic
Previous topic
Table of contents
This document is available on the World Wide Web as
http://www.math.grin.edu/~stone/scheme-web/integer-procedures.html