Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70964 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61703 invoked from network); 2 Jan 2014 19:31:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Jan 2014 19:31:25 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 198.187.29.240 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 198.187.29.240 imap2-1.ox.registrar-servers.com Received: from [198.187.29.240] ([198.187.29.240:50336] helo=imap2-1.ox.registrar-servers.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 47/62-48256-A8EB5C25 for ; Thu, 02 Jan 2014 14:31:24 -0500 Received: from [192.168.0.200] (unknown [2.218.139.184]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by oxmail.registrar-servers.com (Postfix) with ESMTPSA id 2CDD05A006C; Thu, 2 Jan 2014 14:31:18 -0500 (EST) Message-ID: <52C5BE84.1050904@ajf.me> Date: Thu, 02 Jan 2014 19:31:16 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Robert Stoll , 'Rasmus Lerdorf' , internals@lists.php.net References: <001801cf07e9$a07af1e0$e170d5a0$@tutteli.ch> <52C5B5E1.5050609@lerdorf.com> <003c01cf07ee$123e08e0$36ba1aa0$@tutteli.ch> In-Reply-To: <003c01cf07ee$123e08e0$36ba1aa0$@tutteli.ch> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] NAN and INF cast to int From: ajf@ajf.me (Andrea Faulds) On 02/01/14 19:08, Robert Stoll wrote: > > > And the other part about division by 0 yields false. I rethought it and conclude that it makes somewhat sense for a > purely int division. However, it does not make sense for a floating point number division IMO and should be NAN or INF > instead as suggested by IEEE 754. > Yet, since this would be a BC break I understand that it cannot be changed in 5.x but maybe in PHP 6? > Hey, why not make div-by-0 with ints also yield Infinity? It's a nicer and more practical approach than throwing a warning, IMO, because you don't have to check for zero at every single division, you'll just get an eventual output which tells you something went wrong. -- Andrea Faulds http://ajf.me/