From e4b01f109aa65a528127c3eeaaef9d876b4d1705 Mon Sep 17 00:00:00 2001 From: Louis Date: Tue, 5 Sep 2023 15:26:39 +0200 Subject: [PATCH] vault backup: 2023-09-05 15:26:39 --- Algo/Séminaire/Chapter 2 - Functions.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 +```