From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3433 invoked by alias); 30 Apr 2003 15:36:00 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 3414 invoked by uid 71); 30 Apr 2003 15:36:00 -0000 Resent-Date: 30 Apr 2003 15:36:00 -0000 Resent-Message-ID: <20030430153600.3413.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, ftomaz@ualg.pt Received: (qmail 768 invoked by uid 48); 30 Apr 2003 15:32:31 -0000 Message-Id: <20030430153231.767.qmail@sources.redhat.com> Date: Wed, 30 Apr 2003 15:36:00 -0000 From: ftomaz@ualg.pt Reply-To: ftomaz@ualg.pt To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/10566: simple, but big problem X-SW-Source: 2003-04/txt/msg01452.txt.bz2 List-Id: >Number: 10566 >Category: c++ >Synopsis: simple, but big problem >Confidential: no >Severity: critical >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Wed Apr 30 15:36:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: ftomaz@ualg.pt >Release: gcc (GCC) 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk) >Organization: >Environment: Linux Mandrake 9.1 (final) >Description: See the output of both lines of code: 1) Bad cout << (double) floor ( double ( 8.075 * 100 + 0.5 ) ) << endl; it outputs 807, but (8.075 * 100 + 0.5) = 808. Using this argument in the same code it is good (see below) 2) Ok cout << (double) floor ( double ( 808 ) ) << endl; it outputs 808 ... no comments ... >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: