4 Numbers
type
type
type
type
A recognizer for rational numbers.
> (rationalp 5/12) t
> (rationalp 6) t
> (rationalp -8) t
A recognizer for integers.
> (integerp 5/12) nil
> (integerp 42) t
> (integerp -9) t
A recognizer for natural numbers. The natural numbers are the
integers starting from zero and counting up.
> (natp 0) t
> (natp 1) t
> (natp 14) t
> (natp -2) nil
> (natp 5/3) nil
> (natp 1138) t
A recognizer for positive integers. These are the integers
starting from one and counting up.
> (posp 0) nil
> (posp 1) t
> (posp 2) t
> (posp 2187) t
> (posp -47) nil
> (posp 13/31) nil
procedure
a : rational b : rational
procedure
a : rational b : rational
procedure
a : rational b : rational
procedure
a : rational b : rational
Numeric comparison functions.
> (< 4 78) t
> (< 99 2) nil
> (< 8 8) nil
> (<= 3 4) t
> (<= 3 3) t
> (<= 3 2) nil
> (> 8 -3) t
> (> -8 3) nil
> (>= 6 6) t
> (>= 7 6) t
procedure
a : rational b : rational
procedure
a : rational b : rational
procedure
a : rational b : rational
procedure
a : rational b : rational/non-zero
procedure
a : rational
procedure
a : rational/non-zero
Basic arithmetic operations.
> (+ 2 2) 4
> (+ 1 (+ 2 3)) 6
> (+ 6 1) 7
> (* 6 7) 42
> (* 9 3) 27
> (* 45/77 11) 45/7
> (- 15 8) 7
> (- 8 15) -7
> (/ 42 7) 6
> (/ 47 2) 47/2
> (/ 46 6) 23/3
> (unary-- 98) -98
> (unary-- -32) 32
> (unary-/ 54) 1/54
> (unary-/ 1/29) 29