vault backup: 2023-09-05 15:26:39

This commit is contained in:
Louis Gallet 2023-09-05 15:26:39 +02:00
parent 053d5c2f60
commit e4b01f109a
Signed by: lgallet
SSH Key Fingerprint: SHA256:qnW7pk4EoMRR0UftZLZQKSMUImbEFsiruLC7jbCHJAY

View File

@ -75,3 +75,17 @@ _: int = 4 (*same things but with another method*)
``` ```
## 2.3. Function with several parameters (2 or more) ## 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 = <fun>
(*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 = <fun>
# average (-2) (2);;
-: int = 0
```