Guest User

Untitled

a guest
Dec 9th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. let pol a b c =
  2. let p=(a+.b+.c)/.2.0 in sqrt(p*.(p-.a)*.(p-.b)*.(p-.c));;
  3.  
  4. let test a b c =
  5. (a+.b)>c &&(b+.c)>a &&(a+.c)>b
  6.  
  7. let main a b c =
  8. let w=test(a b c) in(
  9. if w
  10. then pol (a b c)
  11. else raise(Failure "Error"));;
  12.  
  13. # let f a b = a + b;;
  14. val f : int -> int -> int = <fun>
  15. # f 3 8;;
  16. - : int = 11
  17.  
  18. # f (3 8);;
  19. Error: This expression has type int
  20. This is not a function; it cannot be applied.
Add Comment
Please, Sign In to add comment