diff --git a/Algo/Séminaire/Chapter 2 - Functions.md b/Algo/Séminaire/Chapter 2 - Functions.md index d646fd1..61901df 100644 --- a/Algo/Séminaire/Chapter 2 - Functions.md +++ b/Algo/Séminaire/Chapter 2 - Functions.md @@ -75,3 +75,17 @@ _: int = 4 (*same things but with another method*) ``` ## 2.3. Function with several parameters (2 or more) + +```Ocaml +(*The logic way (for us)*) +# let average(a,b) = (a+b)/2 ;; +val average: int*int -> int = + +(*This method is not for several parameter, is just a one parameter wich is a couple*) + +(*The OCaml way (the way that it work) *) +# let average a b = (a+b)/2;; +val average: int -> int -> int = +# average (-2) (2);; +-: int = 0 +```