PDA

View Full Version : PHP-problem



Marlon
12 Jun 2010, 02:06 PM
Hi,

i wrote a calculator-PHP-script and it looks like this:
http://phptestacc.ph.ohost.de/Taschenrechner3.php

but there is a problem when i exponentiate a number, for example i put 455 and 23 in the boxes, then as a result comes:
455^23 ist 1.3622666451E+61
23^455 ist INF

but thats wrong, right? So what can i do?


I am sorry for my english, I am from Germany

erilidon
12 Jun 2010, 05:43 PM
well I am pretty sure that in php

INF

means Infinity - so I would assume that the script and/or php just can't handle the calculation.

I tried to do:

<?
echo pow(23,455);
?>

on my server and got the same

INF

but


<?
echo pow(455,23);
?>

returns:


1.3622666451E+61

why not just stick to a trusty scientific calculator?