multiply doit être mis en oeuvre
qu'avec
define lambda if
cond or and not = < > + - format
(multiply 3 0)
0
(multiply 0
3)
0
(multiply 11 3)
33
(multiply -11 3)
-33
(multiply 11
-3)
-33
(multiply -11 -3)
33
quotient
doit être mis en oeuvre qu'avec
define lambda if
cond or and not = < > + - format
(quotient 3 0)
"(quotient 3 0) impossible"
(quotient 0
3)
0
(quotient 11 3)
3
(quotient -11 3)
-3
(quotient 11
-3)
-3
(quotient -11 -3)
3
(quotient -3 11)
0
exposant doit être mis en oeuvre qu'avec
define lambda if
cond or and not = < > + - * / format
(exposant 2 3)
8
(exposant 2
-3)
1/8
(exposant -2 3)
-8
(exposant -2 4)
16
(exposant 2
0)
1
(exposant 0 0)
"(exposant 0 0) impossible "
(exposant 0
2)
0
modulo doit être mis en oeuvre
qu'avec
define lambda if
cond or and not = < > + - format quotient
(modulo 13 3)
1
(modulo 13
-3)
-2
(modulo -13 3)
2
(modulo -13 -3)
-1
(modulo 13
0)
"(modulo 13 0) est impossible "
(modulo 0 13)
13
(modulo 0
0)
"(modulo 0 0) est impossible "
somme-chiffre doit être mis en oeuvre
qu'avec
define lambda if
cond = < > + - or and not quotient modulo and or not
format
(somme-chiffre 45)
9
(somme-chiffre -734)
14
(somme-chiffre
0)
0
pgcd doit être mis en oeuvre
qu'avec
define lambda if
cond = < > + - or and not abs modulo quotient and or let not
format
(pgcd 210 93)
3
(pgcd -210 93)
3
(pgcd
210 -93)
3
(pgcd -210 -93)
3
(pgcd 0 4)
4
(pgcd -4
0)
4
(pgcd 0 0)
"(pgcd 0 0) impossible"
odd? et even? doivent être mutuellement récursives et être définies qu'en fonction de
define lambda if
cond not - or and + - zero?
(odd?
3)
#t
(odd?
4)
#f
(even?
3)
#f
(even?
4)
#t