Created: 12/08/2013 Modified: 13/08/2013
*)
-
-let array_map = fun f -> fun a ->
- let n = Array.length a in
- Array.init n (fun i -> f a.(i));;
-
let array_map2 = fun f -> fun a -> fun b ->
let n1 = Array.length a in
let n2 = Array.length b in
else raise (Invalid_argument "Array.map3 size not matched.");;
let decorate = fun s -> " Faustine -> " ^ s;;
+
+let xor : bool -> bool -> bool =
+ fun a -> fun b -> (a || b) && (not (a && b));;
+
+let rint : float -> float =
+ fun f ->
+ if (f -. (floor f)) >= 0.5 then ceil f
+ else floor f;;