Hi,
Can someone please point me to a Win32 build which has a working NaN? The last few releases on php.net all share the same problems, which are leading to real-world bugs in userland code:
var_dump(NAN); // float(0), should be float(NAN)
$realNaN = sqrt(-1);
var_dump($realNaN); // float(NAN)
var_dump($realNaN == $realNaN); // true, should be false, NaN should never match NaN
Regards,
Stan Vassilev
hi,
Try VC9 snapshots from http://windows.php.net please.
Cheers,
Pierre
2009/5/24 Stan Vassilev sv_forums@fmethod.com:
Hi,
Can someone please point me to a Win32 build which has a working NaN? The last few releases on php.net all share the same problems, which are leading to real-world bugs in userland code:
var_dump(NAN); // float(0), should be float(NAN)
$realNaN = sqrt(-1);
var_dump($realNaN); // float(NAN)
var_dump($realNaN == $realNaN); // true, should be false, NaN should never match NaNRegards,
Stan Vassilev
--
Pierre
hi,
Try VC9 snapshots from http://windows.php.net please.
Cheers,
Pierre
Hi,
Thanks for your pointed, though I couldn't find VC9 builds for any stable
release (5.2.x) of PHP?
I'll check with 5.3.x a bit later, but what is the recommendation for those
of us who have to deploy PHP on Windows today? Go with the RC of 5.3?
Regards,
Stan Vassilev
Hello,
var_dump(NAN); // float(0), should be float(NAN)
$realNaN = sqrt(-1);
var_dump($realNaN); // float(NAN)
var_dump($realNaN == $realNaN); // true, should be false, NaN should never match NaN
That's interesting. With my own 5.2.9 build (vc6), I have "false" in the
last test (comparing the variable):
| # php -n -r "var_dump(NAN);$n=sqrt(-1);var_dump($n);var_dump($n==$n);"
| float(0)
| float(NAN)
| bool(false)
With the official 5.2.9 or 5.2.10-dev builds it's "true" on the same machine
(xp sp3).
BTW: is_nan($realNaN) is working with the official build.
Regards,
Carsten
Hello,
var_dump(NAN); // float(0), should be float(NAN)
$realNaN = sqrt(-1);
var_dump($realNaN); // float(NAN)
var_dump($realNaN == $realNaN); // true, should be false, NaN
should never match NaNThat's interesting. With my own 5.2.9 build (vc6), I have "false" in
the
last test (comparing the variable):
| # php -n -r "var_dump(NAN);$n=sqrt(-1);var_dump($n);var_dump($n==
$n);"
| float(0)
| float(NAN)
| bool(false)With the official 5.2.9 or 5.2.10-dev builds it's "true" on the same
machine
(xp sp3).BTW: is_nan($realNaN) is working with the official build.
is this fixed? and if not .. is there a bug ticket open?
regards,
Lukas Kahwe Smith
mls@pooteeweet.org
Hello,
var_dump(NAN); // float(0), should be float(NAN)
$realNaN = sqrt(-1);
var_dump($realNaN); // float(NAN)
var_dump($realNaN == $realNaN); // true, should be false, NaN should
never match NaNThat's interesting. With my own 5.2.9 build (vc6), I have "false" in the
last test (comparing the variable):
| # php -n -r "var_dump(NAN);$n=sqrt(-1);var_dump($n);var_dump($n==$n);"
| float(0)
| float(NAN)
| bool(false)With the official 5.2.9 or 5.2.10-dev builds it's "true" on the same
machine
(xp sp3).BTW: is_nan($realNaN) is working with the official build.
is this fixed? and if not .. is there a bug ticket open?
It is fixed (there was a bug, do not have it at hand).
--
Pierre