Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Stupid question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Christophe Raffalli <Christophe.Raffalli@u...>
Subject: Re: [Caml-list] Stupid question
Brian Hurt wrote:
> On 15 Jan 2004, skaller wrote:
> 
> 
>>Well, <> is a polymorphic value comparison.
>>Whereas != is a physical inequality comparison.
> 
> 
> Yes.  I was wondering why the compiler didn't catch that I was comparing 
> booleans and thus it could inline the value comparison, and reduce it to 
> the equivelent to !=.  I've gotten into the habit of writting <> because 
> I'm playing around with FP, and 1. <> 1. is false, while 1. != 1. is true.
> 

Usually it is good to avoid comparing float with = and <> ...

|a-b|<epsilon is usually what you really need (except when you use float 
as higher precision int to store date (see Unix.stats) or other similar 
stuff ...). By the way why not use Int64 instead ?



-- 
Christophe Raffalli
Université de Savoie
Batiment Le Chablais, bureau 21
73376 Le Bourget-du-Lac Cedex

tél: (33) 4 79 75 81 03
fax: (33) 4 79 75 87 42
mail: Christophe.Raffalli@univ-savoie.fr
www: http://www.lama.univ-savoie.fr/~RAFFALLI
---------------------------------------------
IMPORTANT: this mail is signed using PGP/MIME
At least Enigmail/Mozilla, mutt or evolution
can check this signature
---------------------------------------------

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners