See it run
LISPEX
(call-with-values (lambda () (exact-integer-sqrt 20)) list)Observed result
OUTPUT
(4 4)How to reason about it
+ - * /are specified to take any number of arguments. Comparisons require at least two arguments, and integer-domain operations reject non-integers.floor/andtruncate/return quotient and remainder as two values.exptaccepts an exact-integer exponent, andexact-integer-sqrtreturns root and remainder.
Numeric signatures
| Signature | Result | Fault boundary |
|---|---|---|
| (+ number ...) / (* number ...) | number, exact unless any operand is inexact | E312 wrong type, E314 non-finite |
| (/ number number ...) | exact rational or finite real | E313 zero divisor, E314 non-finite |
| (floor/ integer integer) | two values, the quotient and the remainder | E312 non-integer, E313 zero divisor |
| (expt number exact-integer) | number preserving base exactness | E313 exact zero to a negative power, E314 unrepresentable |
| (exact-integer-sqrt exact-nonnegative-integer) | two exact values, the root and the remainder | E312 wrong domain |
A common mistake
General transcendental functions and non-finite values are absent.
Keep going
The manual explains the exactness and contagion rules behind these signatures, and the index places them among the other families.