(* 2021-09-27 *) (* Shift F5 *) (* DS S45 *) (* polynome *) let poly a b c = fun x -> a*x*x + b*x + c let poly a b c x = a*x*x + b*x + c let poly = fun a b c x -> a*x*x + b*x + c let poly a = fun b c x -> a*x*x + b*x + c let poly a b = fun c x -> a*x*x + b*x + c let carre x = x * x let compose f g = fun x -> f (g x) let bidon f = fun x -> f (f x) let couple_square x = x, x * x let pair x = x, x let pol (a,b,c) = fun x -> a * x *x + b* x + c let s3 (i, j, f) = i + j + int_of_float f type point = float * float type point2D = Point of float * float type int_or_infinity = Infinity | Int of int let div n d = if d = 0 then if n = 0 then failwith "0/0!" else Infinity else Int (n / d) let perimeter_rect w h = 2. *. (w +. h) let perimeter_circle r = 2. *. 3.14 *. r type form = Square of float | Circle of float | Rectangle of float * float let perimeter form = match form with Rectangle(w, h) -> perimeter_rect w h | Circle r -> perimeter_circle r | Square c -> perimeter_rect c c