JRaz Posted June 12, 2006 Share Posted June 12, 2006 which one of the above is faster? and is pow(x,1/3) the only way to do cube root? Quote Link to comment Share on other sites More sharing options...
Barand Posted June 12, 2006 Share Posted June 12, 2006 1 ) sqrt()[code]$t1 = microtime(true);for($i=1;$i<=1000;$i++){ $x = sqrt($i);}$t2 = microtime(true);for($i=1;$i<=1000;$i++){ $y = pow($i, 1/2);}$t3 = microtime(true);echo 'sqrt : ', $t2-$t1, '<br>';echo 'pow : ', $t3-$t2, '<br>';[/code]2 ) AFAIK it is the only way. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.