Anonymous user
Ethiopian multiplication: Difference between revisions
m
→{{header|OCaml}}
(→{{header|MMIX}}: comment correction) |
|||
Line 909:
<lang ocaml>let ethiopicmult x y =
let rec aux plier pliand acc =
if plier = 0
then
aux (plier / 2) (pliand * 2) acc▼
else
▲ then aux (plier / 2) (pliand * 2) acc
else aux (plier / 2) (pliand * 2) (acc + pliand)
in
'''Usage example''' from the interpreter
|