Re: Power

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/8/06, Khorosh Irani <khorosh@xxxxxxxxx> wrote:> Hello> How I can get the power of an integer number (for example 8 power 2=64) only> with loops (without pow() function)?> Thanks>>
Is this for your homework? Untested:
<?php$num=8;$power=2;
for ($i=0; $i<$power;$i++) {   $num*=$num;}
?>
Dotan Cohenhttp://technology-sleuth.com/short_answer/what_is_hdtv.html&^)

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux