Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37409 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30280 invoked from network); 2 May 2008 18:41:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 May 2008 18:41:51 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 204.11.219.139 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 204.11.219.139 mail.lerdorf.com Received: from [204.11.219.139] ([204.11.219.139:41950] helo=mail.lerdorf.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 75/45-01733-D606B184 for ; Fri, 02 May 2008 14:41:50 -0400 Received: from trainburn-lm.corp.yahoo.com (trainburn-lm.corp.yahoo.com [207.126.233.11]) (authenticated bits=0) by mail.lerdorf.com (8.14.2/8.14.2/Debian-5) with ESMTP id m42Ifimb020242; Fri, 2 May 2008 11:41:45 -0700 Message-ID: <481B6068.9060402@lerdorf.com> Date: Fri, 02 May 2008 11:41:44 -0700 User-Agent: Thunderbird 2.0.0.4 (Macintosh/20070604) MIME-Version: 1.0 To: Stefan Walk CC: Todd Ruth , jbondc@openmv.com, internals@lists.php.net References: <001401c8ac74$dda6d060$98f47120$@com> <1209749793.1075.54.camel@inspiron.local> <481B5F45.4030106@gmail.com> In-Reply-To: <481B5F45.4030106@gmail.com> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Float comparison From: rasmus@lerdorf.com (Rasmus Lerdorf) Stefan Walk wrote: > And you'll quickly see that the "cast to string before comparision" is a > bad idea, because: > $ php -dprecision=1 -r 'var_dump((string)1.4 == (string)1.1);' > bool(true) > > Having display settings affect comparisions seems like a really bad idea > to me ;) Yup, it would be a fatal flaw in the language if that ever came to be. -Rasmus