From: duisters_k at hotmail dot com
Operating system: Win XP SP2
PHP version: 5.2.6
PHP Bug Type: Math related
Bug description: Incorrect outcomes gmp_pow
Description:
------------
When I use gmp_init(), gmp_pow gives incorrect answers.
Reproduce code:
---------------
<pre><?php
$iMessage = ord($_GET['message']);
$rText = gmp_init($iMessage);
$rRandE = gmp_init("7");
?>
Message: <?=gmp_strval($rText)?> <!-- 88 -->
e: <?=gmp_strval($rRandE)?> <!-- 7 -->
Message^e:<?=gmp_strval(gmp_pow($rText,$rRandE))?>
18979061712307928304713728
88^7: <?=gmp_strval(gmp_pow(88,7))?> 40867559636992 (It doesn't matter
here whether I use strings or integers)
pow(88,7):<?=pow(88,7)?> 40867559637000
Expected result:
----------------
Line 8 should give the same outcome as line 9 and (aproximatly) 10
Actual result:
--------------
Different outcomes
--
Edit bug report at http://bugs.php.net/?id=45330&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=45330&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=45330&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=45330&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45330&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=45330&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45330&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45330&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45330&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45330&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45330&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=45330&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=45330&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45330&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45330&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45330&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45330&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45330&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45330&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45330&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45330&r=mysqlcfg