Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52587 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2523 invoked from network); 31 May 2011 21:41:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 May 2011 21:41:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=landeholm@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=landeholm@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: landeholm@gmail.com X-Host-Fingerprint: 209.85.210.170 mail-iy0-f170.google.com Received: from [209.85.210.170] ([209.85.210.170:46728] helo=mail-iy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DE/6E-25701-39065ED4 for ; Tue, 31 May 2011 17:41:40 -0400 Received: by iyb12 with SMTP id 12so5324011iyb.29 for ; Tue, 31 May 2011 14:41:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=+OIZAq9PehjvFEs9cL9ugu1TMftV2mSf5qmU0DnZMB8=; b=esIFqLJrBhHYslSptk5gnI9yxYdVd9n+O4uFO2bJgYbJERAT6IFR12JyEdgy0o589s PdwQdId5GCfMtoCclxVcw6rp64Cs6mbmvIPahSKHMwSvpuLtbPywc11Xa7EsDmfJbcpO wTaxE1Mza5Rctpm4mO7mII9WN/mRgNoSQ3Iu0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=uu41HgkGTFqb2FUhRKQV6YIKUhYJVwyuI9Zxhl9h5Uo8kCUPL07uioDYy8MtIbeYBh IZOYsxaujAATqBZcQS7LnwkvAZgu8kqqebU1BpQrNr6CjQK76sFMp2SYjIDRIpQHLgWD gjYv4syRZS4v6lcOFLRkx6z607A6Mqfn+YS2U= MIME-Version: 1.0 Received: by 10.231.208.142 with SMTP id gc14mr8194557ibb.115.1306878096284; Tue, 31 May 2011 14:41:36 -0700 (PDT) Received: by 10.231.30.141 with HTTP; Tue, 31 May 2011 14:41:36 -0700 (PDT) In-Reply-To: References: <2EFE9027-13EA-4570-B6D2-2C56D85C7DAE@macvicar.net> Date: Tue, 31 May 2011 23:41:36 +0200 Message-ID: To: Julien Pauli , internals@lists.php.net Content-Type: multipart/alternative; boundary=0016e6d27485b19ed704a4994480 Subject: Re: [PHP-DEV] INF behavior From: landeholm@gmail.com (Hannes Landeholm) --0016e6d27485b19ed704a4994480 Content-Type: text/plain; charset=ISO-8859-1 > Agree with Derick, strictly speaking, in maths science, INF != INF. I disagree,based on quote from http://compilers.iecc.com/comparch/article/98-07-134: "Since a projective infinity doesn't have a sign, comparing a floating point value other than infinity to a projective infinity is unordered. However, a projective infinity is equal to itself." Hannes On 31 May 2011 21:39, Julien Pauli wrote: > Agree with Derick, strictly speaking, in maths science, INF != INF. > > But I dont care if PHP tells me than yes, because PHP is not designed > to solve high level maths problems :) > > Cheer, > > Julien.Pauli > > On Fri, May 27, 2011 at 4:48 PM, Derick Rethans wrote: > > On Thu, 26 May 2011, Scott MacVicar wrote: > > > >> On 26 May 2011, at 20:03, Philip Olson wrote: > >> > >> > Hello geeks, > >> > > >> > A geek is needed to clarify PHP bug #45712. This is an edge case but > the test (bug45712.phpt) contains code similar to the following: > >> > > >> > >> > $inf = pow(0, -2); > >> > > >> > var_dump($inf); // float(INF) > >> > var_dump($inf == $inf); // bool(false) > >> > var_dump($inf === $inf); // bool(true) > >> > ?> > >> > > >> > That's how it's behaved since ~forever (AFAICT) and remains in > 5.3.7-dev, but PHP 5.4.0-dev changes behavior so both now return true. > >> > > >> > Is this is how we want it? And how should this be > documented/explained? > >> > >> I think I changes this :-) > >> > >> It didn't make sense that == and === produce different results. > >> > >> Though if someone has a better understanding of maths then we can fix > it. > > > > I think it does make sense. == is the equal operator, and INF is not > > equal to INF (just like SQL NULL is not equal to NULL). However, they > > are identical (like you can test in SQL with NULL IS NULL). > > > > cheers, > > Derick > > > > -- > > http://derickrethans.nl | http://xdebug.org > > Like Xdebug? Consider a donation: http://xdebug.org/donate.php > > twitter: @derickr and @xdebug > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --0016e6d27485b19ed704a4994480--