From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: ** X-Spam-Status: No, score=2.6 required=5.0 tests=NO_DNS_FOR_FROM autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 77333BBAF for ; Fri, 25 Jul 2008 22:55:01 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmUBAEjaiUiBYYw6jWdsb2JhbACSWAEBAQEJBQgYBZ0HAw X-IronPort-AV: E=Sophos;i="4.31,253,1215381600"; d="asc'?scan'208";a="27683822" Received: from services107.math.uwaterloo.ca ([129.97.140.58]) by mail4-smtp-sop.national.inria.fr with ESMTP; 25 Jul 2008 22:55:00 +0200 Received: from saturn (CPE00195b945ab9-CM001a6682b9fa.cpe.net.cable.rogers.com [99.249.252.9]) (authenticated bits=0) by services107.math.uwaterloo.ca (8.13.8/8.13.8) with ESMTP id m6PKsioa001640 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Fri, 25 Jul 2008 16:54:57 -0400 (EDT) Received: from matt by saturn with local (Exim 4.69) (envelope-from ) id 1KMTgE-0001e7-16 for caml-list@yquem.inria.fr; Fri, 25 Jul 2008 16:14:22 -0400 Date: Fri, 25 Jul 2008 16:14:22 -0400 From: Matthew William Cox To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] equality operators in OCaml Message-ID: <20080725201421.GA6015@saturn.mattcox.ca> References: <4888D7B7.8030703@rice.edu> <732669E74A7B4E49A8F225F86C335C5E@frodo> <200807242140.40245.peng.zang@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tThc/1wpZn/ma/RB" Content-Disposition: inline In-Reply-To: <200807242140.40245.peng.zang@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (services107.math.uwaterloo.ca [129.97.140.58]); Fri, 25 Jul 2008 16:54:58 -0400 (EDT) X-Miltered: at mailchk-m01 with ID 488A3D94.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Virus-Scanned: ClamAV version 0.93.1, clamav-milter version 0.93.1 on localhost X-Virus-Status: Clean X-UUID: a7b9346f-9a41-4be8-b8cd-78ceaa8e14a5 X-Spam: no; 0.00; ocaml:01 structurally:01 redefined:01 peng:98 equality:01 idiom:01 wrote:01 caml-list:01 numerical:03 fix:05 jul:05 thu:05 nan:06 nan:06 space:07 X-Attachments: type="application/pgp-signature" name="signature.asc" --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 equa= l=20 > (they occupy the same memory space) it doesn't make sense for them to be= =20 > structurally unequal (contain different content). Personally, one of the= =20 > first things I did is redefined (=3D) 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 =3D x then (* x is a number *) else (* x is NaN *) Matt --tThc/1wpZn/ma/RB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkiKNB0ACgkQLzoc++7UJR+qZQCggksFZ7rHWkCtdMmB211Q7+sK nmgAoMORh2v98+DV2xnmV0Ty3pkuV3CG =QX9R -----END PGP SIGNATURE----- --tThc/1wpZn/ma/RB--