Posted by Dotan Cohen on 01/08/06 22:29
On 1/8/06, Khorosh Irani <khorosh@gmail.com> 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 Cohen
http://technology-sleuth.com/short_answer/what_is_hdtv.html
&^
)
Navigation:
[Reply to this message]
|