From: Christophe Raffalli <Christophe.Raffalli@univ-savoie.fr>
To: Brian Hurt <bhurt@spnz.org>
Cc: skaller <skaller@tpg.com.au>, Ocaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] Stupid question
Date: Thu, 15 Jan 2004 09:37:08 +0100 [thread overview]
Message-ID: <40065134.7000402@univ-savoie.fr> (raw)
In-Reply-To: <Pine.LNX.4.44.0401150011540.4373-100000@localhost.localdomain>
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
next prev parent reply other threads:[~2004-01-15 8:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-15 0:03 Brian Hurt
2004-01-15 3:57 ` skaller
2004-01-15 6:13 ` Brian Hurt
2004-01-15 8:37 ` Christophe Raffalli [this message]
2004-01-16 0:43 ` Jacques Garrigue
2004-01-16 2:35 ` Brian Hurt
2004-01-16 8:40 ` Hendrik Tews
2004-01-16 10:25 ` Frederic van der Plancke
2004-01-16 12:07 ` Alex Baretta
2004-01-16 5:41 ` Nicolas Cannasse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40065134.7000402@univ-savoie.fr \
--to=christophe.raffalli@univ-savoie.fr \
--cc=bhurt@spnz.org \
--cc=caml-list@inria.fr \
--cc=skaller@tpg.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox