#32320 [Fbk->Opn]: Problem with negative exponent handling
| From: | blucasco at gmail dot com | Date: | Wed, 16 Mar 2005 15:56:03 +0000 |
| Subject: | #32320 [Fbk->Opn]: Problem with negative exponent handling | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-75396@lists.php.net to get a copy of this message | ||
ID: 32320
User updated by: blucasco at gmail dot com
Reported By: blucasco at gmail dot com
-Status: Feedback
+Status: Open
Bug Type: Output Control
Operating System: FC3
PHP Version: 5.0.3
New Comment:
I think that's a good thing (tm) if it outputs correctly for you --
perhaps it was some element of the build on FC3.
But I must caution (before my bug gets immediately discounted), the
incorrect results in 5.0.3 listed here were the exact same on two
different machines with different processors (AMD vs Intel) with a
source build of PHP 5.0.3, running FC3.
Glibtools, gcc, c++, binutils were all slightly different versions on
both machines to minimize the chance that it was a anamoly with one of
those builds.
I rebuilt a machine with SuSE and will post results of same test here.
But, it would be beneficial if someone with FC3 can address whether this
actually happens on their machine.
Previous Comments:
------------------------------------------------------------------------
[2005-03-16 07:48:10] sniper@php.net
Can you explain why I get exactly same results with both PHP 4 and 5 ?
------------------------------------------------------------------------
[2005-03-15 19:08:37] blucasco at gmail dot com
Description:
------------
PHP 5.03 appears to handle math equations with negative exponents
differently than PHP 4.3.x. I am trying to use the following example
in a larger script, but the primary difference is included below.
Reproduce code:
---------------
PHP 4.3:
<? echo (-4738698913^43814); ?>
outputs:
-443704711
PHP 5.03:
<? echo (-4738698913^43814); ?>
outputs:
-2147439834
Expected result:
----------------
I believe 5.03 should output what 4.3 does, but this is an
extraordinarily large number so I can't say for certain.
PHP 4.3:
<? echo (-4738698913^43814); ?>
outputs:
-443704711
Actual result:
--------------
PHP 5.03:
<? echo (-4738698913^43814); ?>
outputs:
-2147439834
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32320&edit=1