Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] function type confusion (using let)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Michael Leary <leary@n...>
Subject: Re: [Caml-list] function type confusion (using let)
I always think of something right after I ask... which is why I ask, I
suppose...

Well, this compiles, but looks funny:

let normr r =
  let x = mod_float r pi2 in
  match x > 0.0 with
  | true ->
      if x > pi then
        -.pi2 +. x
      else
        x
  | false ->
      if x < -.pi then
        pi2 +. x
      else
        x

Is there a different way?

-- 
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr