**是新的幂运算符,而不是php中的power() [英] ** is new power operator instead of power() in php
本文介绍了**是新的幂运算符,而不是php中的power()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在新版本的php(5.6)中使用新版本的Power运算符代替pow()
?
喜欢:
How to use new version of Power operator instead of pow()
in new version of php (5.6)?
Like:
echo pow(2,3);
推荐答案
php 5.6 +
There is a sample ** operator in php 5.6 +
$i = 6;
$i **=2; //output 36
$out = $i ** 3 //output 216
echo 2 ** 3 ** 2; // 512 (not 64)
echo -3 ** 2; // -9 (not 9)
echo 1 - 3 ** 2; // -8
echo ~3 ** 2; // -10 (not 16)
**
优于pow(,)
.
当您尝试编写数学算法时. **
是强大的运算符.
它与pow之间没有功能上的区别.
电力运营商的出价
**
is better than pow(,)
.
When you try to write a math algorithm. **
is a Powerful Operator.
there's no functional difference between it and pow.
power operator refrence
这篇关于**是新的幂运算符,而不是php中的power()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文