From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23565 invoked by alias); 9 Oct 2002 18:43:08 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 23556 invoked from network); 9 Oct 2002 18:43:07 -0000 Received: from unknown (HELO smtp-relay-3.sea.adobe.com) (192.150.22.10) by sources.redhat.com with SMTP; 9 Oct 2002 18:43:07 -0000 Received: from inner-relay-3.corp.adobe.com (inner-relay-3 [153.32.251.51]) by smtp-relay-3.sea.adobe.com (8.12.3/8.12.3) with ESMTP id g99Ig0Zm022995 for ; Wed, 9 Oct 2002 11:42:00 -0700 (PDT) Received: from iplan-mn.corp.adobe.com (iplan-mn.corp.adobe.com [130.248.25.5]) by inner-relay-3.corp.adobe.com (8.12.3/8.12.3) with ESMTP id g99IdNUv029145 for ; Wed, 9 Oct 2002 11:39:23 -0700 (PDT) Received: from mn-eljaypc.adobe.com ([130.248.184.140]) by iplan-mn.corp.adobe.com (Netscape Messaging Server 4.15 mn Jul 11 2001 16:32:57) with ESMTP id H3Q9BS00.36H; Wed, 9 Oct 2002 13:43:04 -0500 Message-Id: <4.3.2.7.2.20021009133640.00b4f928@iplan-mn.corp.adobe.com> X-Sender: eljay@iplan-mn.corp.adobe.com Date: Wed, 09 Oct 2002 11:43:00 -0000 To: Emil Block , gcc-help@gcc.gnu.org From: Eljay Love-Jensen Subject: Re: [Fwd: Formatted Read Accuracy] In-Reply-To: <3DA4763E.626DB3AD@his.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-SW-Source: 2002-10/txt/msg00092.txt.bz2 Hi Blime, Floating point numbers -- IEEE 754, 32-bit "float", 64-bit "double", or any of the other more-or-less standard formats -- cannot perfectly represent any arbitrary decimal portion of all rational numbers. For instance, 0.5 can be perfectly represented. Consider that "0.5" (decimal) is "0.8" (hexadecimal). Exactly. 0.1 cannot be perfectly represented. Consider that "0.1" (decimal) would be "0.1999999999999999999999999999999..." (hexadecimal). Since floating point numbers do not have infinite precision, some rounding occurs. To alleviate the problem, consider using fixed point numbers, or using BCD numbers. Sincerely, --Eljay