Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27485 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94215 invoked by uid 1010); 16 Jan 2007 15:35:29 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 94196 invoked from network); 16 Jan 2007 15:35:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jan 2007 15:35:29 -0000 Authentication-Results: pb1.pair.com header.from=cschneid@cschneid.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=cschneid@cschneid.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cschneid.com from 195.141.85.117 cause and error) X-PHP-List-Original-Sender: cschneid@cschneid.com X-Host-Fingerprint: 195.141.85.117 uf1.search.ch Linux 2.4/2.6 Received: from [195.141.85.117] ([195.141.85.117:51669] helo=smtp.rim.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 86/04-05231-FB0FCA54 for ; Tue, 16 Jan 2007 10:35:28 -0500 Received: from localhost (localhost [127.0.0.1]) by rolig.search.ch (Postfix) with ESMTP id 067F817659D for ; Tue, 16 Jan 2007 16:35:24 +0100 (CET) Received: from smtp.rim.ch ([127.0.0.1]) by localhost (search.ch [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 03534-06 for ; Tue, 16 Jan 2007 16:35:19 +0100 (CET) Received: from [192.168.1.72] (ultrafilter-i [192.168.85.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by rolig.search.ch (Postfix) with ESMTP id 38BD31764B9 for ; Tue, 16 Jan 2007 16:35:18 +0100 (CET) Message-ID: <45ACF0B5.7080809@cschneid.com> Date: Tue, 16 Jan 2007 16:35:17 +0100 User-Agent: Thunderbird 1.5.0.9 (X11/20060911) MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at search.ch Subject: GCC / Rounding Problem From: cschneid@cschneid.com (Christian Schneider) I tracked down the failure of test ext/standard/tests/math/bug24142.phpt when I tried PHP 4.4.5RC1 and found out the following: The brokenness test in the configure script, namely #include int main() { return floor(0.045*pow(10,2) + 0.5)/10.0 != 0.5; } didn't work properly for me. I changed it to the following to detect the proper PHP_ROUND_FUZZ (reducing it further changed its behaviour): #include int main(int argc, char **argv) { double value = 0.045; value = floor(value * 100.0 + 0.5) / 100.0; return value != 0.05; } Reproduction sequence: cschneid@abflex:~/ $ cc -lm -O0 -Wall -o t t.c cschneid@abflex:~/ $ ./t && echo OK OK cschneid@abflex:~/ $ cc -lm -O2 -Wall -o t t.c cschneid@abflex:~/ $ ./t && echo OK cschneid@abflex:~/ $ System information: SUSE LINUX 10.0 (i586) gcc version 4.0.2 20050901 (prerelease) (SUSE Linux) The difference doesn't exist (i.e. I guess the gcc problem was fixed) in SUSE LINUX 10.1 / gcc version 4.1.0 (SUSE Linux). Do you think the configure script should be changed? I'm not sure if my version of the test works on the system where the original test was developed. Regards, - Chris