From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30258 invoked by alias); 6 Jul 2005 12:38:56 -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 30195 invoked by uid 22791); 6 Jul 2005 12:38:43 -0000 Received: from [194.90.79.130] (HELO argo2k.argo.co.il) (194.90.79.130) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 06 Jul 2005 12:38:43 +0000 Received: from blast.q ([10.11.9.5]) by argo2k.argo.co.il with Microsoft SMTPSVC(5.0.2195.6713); Wed, 6 Jul 2005 15:38:40 +0300 Subject: Re: tr1::unordered_set bizarre rounding behavior (x86) From: Avi Kivity To: Gabriel Dos Reis Cc: gcc@gcc.gnu.org In-Reply-To: References: <42CABDCC.3070508@suse.de> Content-Type: text/plain Date: Wed, 06 Jul 2005 12:38:00 -0000 Message-Id: <1120653519.2989.1.camel@blast.q> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SW-Source: 2005-07/txt/msg00215.txt.bz2 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.