|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchespower-two (last revision 2013-12-19 21:16 UTC by ivo dot urbanek at yahoo dot co dot uk)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-12-19 21:13 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2013-12-19 21:13 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 06:00:01 2026 UTC |
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 !