Re: INF behavior
| From: | Scott MacVicar | Date: | Fri, 27 May 2011 04:10:30 +0000 |
| Subject: | Re: INF behavior | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-52514@lists.php.net to get a copy of this message | ||
On 26 May 2011, at 20:03, Philip Olson <philip@roshambo.org> 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:
>
> <?php
> $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.
S