From: Peng Zang <peng.zang@gmail.com>
To: caml-list@yquem.inria.fr
Cc: Matthew William Cox <matt@mattcox.ca>
Subject: Re: [Caml-list] equality operators in OCaml
Date: Fri, 25 Jul 2008 18:27:48 -0400 [thread overview]
Message-ID: <200807251827.51454.peng.zang@gmail.com> (raw)
In-Reply-To: <20080725201421.GA6015@saturn.mattcox.ca>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Friday 25 July 2008 04:14:22 pm Matthew William Cox wrote:
> On Thu, Jul 24, 2008 at 09:40:36PM -0400, Peng Zang wrote:
> > Yeah, that always seemed broken to me. If two things are physically
> > equal (they occupy the same memory space) it doesn't make sense for them
> > to be structurally unequal (contain different content). Personally, one
> > of the first things I did is redefined (=) to fix this.
>
> It's not broken at all, but complient with a common and longstanding
> idiom (at least amoung scientists working with numerical codes.) The way
> we test for NaN is by comparing to itself, eg:
>
> if x = x then (* x is a number *) else (* x is NaN *)
>
> Matt
Yeah, I just learned that today. But these days, most languages have
functions for testing for NaN. OCaml has classify_float for example. Just
FYI
Peng
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
iD8DBQFIilNnfIRcEFL/JewRAiRjAJ9jRQy37/JtI+nZ9fhiInp3HOvKWgCgtmIv
k2koED9DunAM73PmaEPhnbg=
=SaDz
-----END PGP SIGNATURE-----
prev parent reply other threads:[~2008-07-25 22:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-24 19:27 Raj Bandyopadhyay
2008-07-24 22:15 ` [Caml-list] " Vincent Hanquez
2008-07-24 22:32 ` Jon Harrop
2008-07-25 1:40 ` Peng Zang
2008-07-25 10:34 ` Christophe TROESTLER
2008-07-25 12:04 ` Peng Zang
2008-07-25 20:14 ` Matthew William Cox
2008-07-25 22:27 ` Peng Zang [this message]
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=200807251827.51454.peng.zang@gmail.com \
--to=peng.zang@gmail.com \
--cc=caml-list@yquem.inria.fr \
--cc=matt@mattcox.ca \
/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