Two ** in PHP can directly find the nth power of a number. Why is there still a pow() function?

WBOY
Release: 2016-09-30 09:37:30
Original
1478 people have browsed it

<code>$a = 2**6;
echo $a;
$b = pow(2,6);
echo $b;</code>
Copy after login
Copy after login

?>

Reply content:

<code>$a = 2**6;
echo $a;
$b = pow(2,6);
echo $b;</code>
Copy after login
Copy after login

?>

You have to look at when this operator was implemented

https://wiki.php.net/rfc/pow-...

Because it needs to be backward compatible

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template