vault backup: 2023-09-15 16:21:59
This commit is contained in:
parent
3f37a1ccb5
commit
6046e77572
@ -369,8 +369,11 @@ let rec multiply x y =
|
|||||||
|
|
||||||
## Exercise 4.11
|
## Exercise 4.11
|
||||||
```Ocaml
|
```Ocaml
|
||||||
let rec puissance = function
|
let rec puissance x n =
|
||||||
|n when n = 0 -> 1
|
if n = 0 then
|
||||||
|n when n = 1 -> x
|
1
|
||||||
|n ->
|
else if n = 1 then
|
||||||
|
x
|
||||||
|
else
|
||||||
|
x*puissance x (n-1);;
|
||||||
```
|
```
|
Loading…
x
Reference in New Issue
Block a user