vault backup: 2023-09-15 14:51:50

This commit is contained in:
2023-09-15 14:51:50 +02:00
parent b5ec7a1ce4
commit c297a59106
3 changed files with 18 additions and 5 deletions

View File

@ -355,4 +355,14 @@ let rec multiply x y =
multiply (x / 2) (y * 2)
else
y + multiply (x / 2) (y * 2)
(*correction*)
# let egypt a b =
let (a, b) = if a > b then (a,b) else (b,a) in
let rec eg = function
| 0 -> 0
| b -> 2*eg(b/2) + (if b mod 2 = 0 then 0 else a)
in
eg b;;
```