fix: README -> README.md
This commit is contained in:
parent
43e68af625
commit
99b0a6292c
756 changed files with 323753 additions and 71 deletions
12
ta6ob/examples/power.ss
Normal file
12
ta6ob/examples/power.ss
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
;;; doubly recursive power (expt) function
|
||||
|
||||
;;; try using trace-lambda to see the nesting.
|
||||
|
||||
(define power
|
||||
(lambda (x n)
|
||||
(cond
|
||||
[(= n 0) 1]
|
||||
[(= n 1) x]
|
||||
[else
|
||||
(let ([q (quotient n 2)])
|
||||
(* (power x q) (power x (- n q))))])))
|
||||
Reference in a new issue