From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8202 invoked by alias); 21 May 2003 11:36:01 -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 8185 invoked by uid 71); 21 May 2003 11:36:01 -0000 Date: Wed, 21 May 2003 11:36:00 -0000 Message-ID: <20030521113601.8184.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Jos van den Oever Subject: Re: c++/10902: comparing doubles is not consistent in gcc 3.3 (SuSE version) Reply-To: Jos van den Oever X-SW-Source: 2003-05/txt/msg02286.txt.bz2 List-Id: The following reply was made to PR c++/10902; it has been noted by GNATS. From: Jos van den Oever To: gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org Cc: Subject: Re: c++/10902: comparing doubles is not consistent in gcc 3.3 (SuSE version) Date: Wed, 21 May 2003 13:34:16 +0200 Another addition to the report. Comparing doubles in c does work properly: #include #include int main() { double one = 1.0; double belowone = 1.0-DBL_EPSILON; if (one == belowone) { printf("one == belowone\n"); } else { printf("one != belowone\n"); } if (1.0 == 1.0 - DBL_EPSILON) { printf("1.0 == 1.0 - DBL_EPSILON\n"); } else { printf("1.0 != 1.0 - DBL_EPSILON\n"); } return 0; } gives output: one != belowone 1.0 != 1.0 - DBL_EPSILON