From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8706 invoked by alias); 6 Jul 2005 12:54:54 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 8556 invoked by uid 22791); 6 Jul 2005 12:54:45 -0000 Received: from mtagate1.de.ibm.com (HELO mtagate1.de.ibm.com) (195.212.29.150) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 06 Jul 2005 12:54:45 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate1.de.ibm.com (8.12.10/8.12.10) with ESMTP id j66CsgFu184260 for ; Wed, 6 Jul 2005 12:54:42 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j66Csgi8163140 for ; Wed, 6 Jul 2005 14:54:42 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11/8.13.3) with ESMTP id j66Csgro015035 for ; Wed, 6 Jul 2005 14:54:42 +0200 Received: from d12ml102.megacenter.de.ibm.com (d12ml102.megacenter.de.ibm.com [9.149.166.138]) by d12av02.megacenter.de.ibm.com (8.12.11/8.12.11) with ESMTP id j66CsgDY015025; Wed, 6 Jul 2005 14:54:42 +0200 In-Reply-To: <1120653519.2989.1.camel@blast.q> Subject: Re: tr1::unordered_set bizarre rounding behavior (x86) To: Avi Kivity Cc: gcc@gcc.gnu.org, Gabriel Dos Reis Message-ID: From: Michael Veksler Date: Wed, 06 Jul 2005 12:54:00 -0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-SW-Source: 2005-07/txt/msg00220.txt.bz2 Avi Kivity wrote on 06/07/2005 15:38:38: > On Tue, 2005-07-05 at 20:05 +0200, Gabriel Dos Reis wrote: > > Paolo Carlin > > It is definitely a good thing to use the full bits of value > > representation if we ever want to make all "interesting" bits part of > > the hash value. For reasonable or sane representations it suffices to > > get your hand on the object representation, e.g.: > > > > const int objsize = sizeof (double); > > typedef unsigned char objrep_t[objsize]; > > double x = ....; > > objrep_t& p = reintepret_cast(x); > > // ... > > > > and let frexp and friends only for less obvious value representation. > > most architectures have different bit representations for +0.0 and -0.0, > yet the two values compare equal. > Yet, their sign bit is observable through things like assert(a == 0.0); assert(b == 0.0); 1/(1/a+ 1/b) which would give either NaN or 0 depending on the sign of a and b. So do you want one or two copies in the set?