mp1-sol - if n < 0 then -n else n else if m...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
(* CS421 - Summer 2009 * MP1 * * Please keep in mind that there may be more than one * way to solve a problem. *) open Mp1common (* Problem 1 *) let x = 1304 (* Problem 2 *) let y = 4.21 (* Problem 3 *) let square_minus_x z = z * z - x (* Problem 4 *) let square_plus_y z = z *. z +. y (* Problem 5 *) let abs_largest n m = if n > m then
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: if n < 0 then -n else n else if m < 0 then -m else m (* Problem 6 *) let greetings name = if name = "Kirill" then print_string "Greetings, Kirill." else print_string ("Hi " ^ name ^ ", welcome to CS421!") (* Problem 7 *) let triple_the_fun f n = f (f (f n))...
View Full Document

Ask a homework question - tutors are online