See it run
LISPEX
(call-with-values (lambda () (exact-integer-sqrt 20)) list)Observed result
OUTPUT
(4 4)How to reason about it
+ - * /are variadic as specified; comparisons require at least two arguments; integer-domain operations reject non-integers.floor/andtruncate/return quotient and remainder as two values.exptaccepts an exact-integer exponent;exact-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: quotient, remainder | E312 non-integer; E313 zero divisor |
| (expt number exact-integer) | number preserving base exactness | E313 exact zero to negative; E314 unrepresentable |
| (exact-integer-sqrt exact-nonnegative-integer) | two exact values: root, remainder | E312 wrong domain |
A common mistake
General transcendental functions and non-finite values are absent.
Keep going
Use this page while writing code. For a guided explanation, return to the syntax map or the corresponding manual.