Bug #53632 [Com]: PHP hangs on numeric value 2.2250738585072011e-308
| From: | cswarth at gmail dot com | Date: | Tue, 04 Jan 2011 05:48:59 +0000 |
| Subject: | Bug #53632 [Com]: PHP hangs on numeric value 2.2250738585072011e-308 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-157533@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53632&edit=1
ID: 53632
Comment by: cswarth at gmail dot com
Reported by: exploringbinary at gmail dot com
Summary: PHP hangs on numeric value 2.2250738585072011e-308
Status: Assigned
Type: Bug
Package: Math related
PHP Version: 5.3.4
Assigned To: dmitry
Block user comment: N
Private report: N
New Comment:
Doesn't happen on a mac.
$ php -v
PHP 5.3.1 (cli) (built: Feb 11 2010 02:32:22)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
$ php -r "print 2.2250738585072011e-308;"
2.2250738585072E-308
Previous Comments:
------------------------------------------------------------------------
[2011-01-02 16:52:43] exploringbinary at gmail dot com
I also get the same problem on Linux (PHP Version 5.3.2-1ubuntu4.5).
------------------------------------------------------------------------
[2011-01-02 16:49:48] pajoye@php.net
Dmitry, can you take a look at it please?
------------------------------------------------------------------------
[2011-01-02 16:44:38] exploringbinary at gmail dot com
(Remove 2.2250738585072012e-308 from my list of examples; it does NOT
map to the same floating-point number as 2.2250738585072011e-308 -- when
converted correctly!)
------------------------------------------------------------------------
[2010-12-30 06:58:41] exploringbinary at gmail dot com
Description:
------------
If I assign the value 2.2250738585072011e-308 to a variable, e.g. $d =
2.2250738585072011e-308, PHP hangs (loops). I am using PHP 5.3.1 XAMPP
1.7.3 on Windows.
2.2250738585072011e-308 represents the largest subnormal
double-precision floating-point number,
0.1111111111111111111111111111111111111111111111111111 x 2^-1022.
Interestingly, nearby decimal literals 2.2250738585072008e-308,
2.2250738585072009e-308, 2.2250738585072010e-308 and
2.2250738585072012e-308 -- which all convert to the same floating-point
value -- do not cause this problem.
Test script:
---------------
<?php $d = 2.2250738585072011e-308; ?>
Expected result:
----------------
No Hang.
Actual result:
--------------
Hang.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53632&edit=1