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=1.4 required=5.0 tests=AWL,DNS_FROM_RFC_POST, SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 00C85BBAF for ; Fri, 25 Jul 2008 14:05:03 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtMCAIheiUjRVcbjemdsb2JhbACSFEMBAQ4iA5gJhXE X-IronPort-AV: E=Sophos;i="4.31,252,1215381600"; d="scan'208";a="15449255" Received: from rv-out-0506.google.com ([209.85.198.227]) by mail3-smtp-sop.national.inria.fr with ESMTP; 25 Jul 2008 14:04:20 +0200 Received: by rv-out-0506.google.com with SMTP id f6so2898083rvb.3 for ; Fri, 25 Jul 2008 05:04:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:reply-to:to:subject:date :user-agent:cc:references:in-reply-to:content-type :content-transfer-encoding:content-disposition:message-id; bh=YuPCHbnXvgBQBlAIvrhVumMRo7eyFSjwp/TQ5D6q2VY=; b=Q4O/2GSKp8uChmqWCl8CxVHeUqw7/f2XT8GheiKsUvl+16+jHuJnJtmQ/TXMZ52cl2 ZajBjvXDtXoWeR7QaKm92uAdpS7n/fQrEjut0iIQLU6tzfZpQqdV5ZUwY/cLdtdZ7TOB Ypkrv3NrKhA34PlmtI6vXIAAhTh+lR+j960vY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:reply-to:to:subject:date:user-agent:cc:references:in-reply-to :content-type:content-transfer-encoding:content-disposition :message-id; b=KhWd+QZmEMLm239ZuXWLiIiCvU4vdvbnJs3WYuMhL9SvOhscnHZEBweW8ZyDf0Q97x UkbCk5T+qucu02x9SR88zQyr1/9tJT4BDj+wThFBR0xTVd1WPqlJkDMdHSUdh/91cRx/ 7nLUSstrq4gAR/ajionFQ5CKWyBT7zndzReFM= Received: by 10.114.56.4 with SMTP id e4mr1806656waa.0.1216987458844; Fri, 25 Jul 2008 05:04:18 -0700 (PDT) Received: from lawn-143-215-204-204.lawn.gatech.edu ( [143.215.204.204]) by mx.google.com with ESMTPS id 34sm8429455yxm.0.2008.07.25.05.04.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 25 Jul 2008 05:04:17 -0700 (PDT) From: Peng Zang Reply-To: peng.zang@gmail.com To: Christophe TROESTLER Subject: Re: [Caml-list] equality operators in OCaml Date: Fri, 25 Jul 2008 08:04:14 -0400 User-Agent: KMail/1.9.7 Cc: caml-list@yquem.inria.fr, rajb@rice.edu References: <4888D7B7.8030703@rice.edu> <200807242140.40245.peng.zang@gmail.com> <20080725.123454.62538826676999671.Christophe.Troestler+ocaml@umh.ac.be> In-Reply-To: <20080725.123454.62538826676999671.Christophe.Troestler+ocaml@umh.ac.be> Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200807250804.16528.peng.zang@gmail.com> X-Spam: no; 0.00; ocaml:01 hash:01 christophe:01 troestler:01 structurally:01 structurally:01 redefined:01 citeseer:01 ocaml:01 nans:01 nans:01 peng:98 peng:98 psu:98 treatments:98 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday 25 July 2008 06:34:54 am Christophe TROESTLER wrote: > On Thu, 24 Jul 2008 21:40:36 -0400, Peng Zang wrote: > > On Thursday 24 July 2008 06:32:36 pm Jon Harrop wrote: > > > There are some complications here. Firstly, NaN has multiple > > > representations that may or may not be physically equal but is always > > > structurally unequal to itself. > > > > 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. > > Humm... http://citeseer.ist.psu.edu/goldberg91what.html is certainly > a good read... > > My 0.02¤, > C. I second that. Particularly relevant is how there is not one unique NaN but a family of them. OCaml has three treatments for them: 1) (=) treats all NaNs as different (even if they may in fact, at the bit level, be the same) 2) (compare) treats all NaNs as the same (even if they may in fact, at the bit level be different) 3) (==) two NaNs are equal iff they share the same memory (2) tends to come up the most often as you typically don't care what kind of NaN it is, as long as it is one. Peng -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) iD8DBQFIicFAfIRcEFL/JewRAiFkAJ46YFay72ONIDD7qk75/izt9ne8gACgvMzu EYZkQb7fYAlEU+KXnixp7to= =5iAB -----END PGP SIGNATURE-----