Skip to content

Instantly share code, notes, and snippets.

@takahisa
Last active August 29, 2015 14:07
Show Gist options
  • Save takahisa/aa127242e235c3e7895a to your computer and use it in GitHub Desktop.
Save takahisa/aa127242e235c3e7895a to your computer and use it in GitHub Desktop.
let quad_eq a b c =
let eq = b * b - 4 * a * c in
let ret = begin
if eq > 0 then
2
else if eq = 0 then
1
else
0
end in
print_int ret;
ret
;;
quad_eq 1 2 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment