daily pastebin goal
45%
SHARE
TWEET

Untitled

a guest Dec 9th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top