Bug #66326 [NEW]: math oparation
| From: | ivo dot urbanek at yahoo dot co dot uk | Date: | Thu, 19 Dec 2013 21:11:43 +0000 |
| Subject: | Bug #66326 [NEW]: math oparation | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-183404@lists.php.net to get a copy of this message | ||
From: ivo dot urbanek at yahoo dot co dot uk
Operating system: Win 7 x64 / openSUSE 12.3
PHP version: 5.4.23
Package: *General Issues
Bug Type: Bug
Bug description:math oparation
Description:
------------
Great problem with calculation power two - how easy, have a look
B^2 = B*B
but not in PHP. Please run a example. If B = 12E4, than B*B is not B^2
!!!
Test script:
---------------
$A=1; $B=6.911824E4; $C=3.95554E8;
// $D = $B^2-4*$A*$C; $sqr=sqrt($D); echo "discriminant = $D
<br>";
$D = $B*$B; echo "B*B = $D <br>";
$D = $B^2; echo "B^2 = $D <br>"; # <-- Here is deferent number
!!!
// $D = 4*$A*$C; echo "4*A*C = $D <br>";
Expected result:
----------------
B*B = 4777331100.6976
B^2 = 69116 # <-- Incorrect !
B*B = 4777331100.6976 # good answer
Actual result:
--------------
B^2 = 69116 # <-- Incorrect !
--
Edit bug report at https://bugs.php.net/bug.php?id=66326&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66326&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66326&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66326&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66326&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66326&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66326&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66326&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66326&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66326&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66326&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66326&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66326&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66326&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66326&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66326&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66326&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66326&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66326&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66326&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66326&r=mysqlcfg