(PHP 4, PHP 5, PHP 7)
pow — 指锟斤拷锟斤拷锟绞�
锟斤拷锟斤拷 base
锟斤拷
exp
锟轿凤拷锟斤拷锟捷★拷锟斤拷锟斤拷锟斤拷埽锟斤拷锟斤拷锟斤拷锟斤拷岱碉拷锟�
integer锟斤拷
base
The base to use
exp
指锟斤拷
base
锟斤拷
exp
锟轿凤拷锟斤拷锟捷★拷
If both arguments are non-negative integers and the result can be represented
as an integer, the result will be returned with integer type,
otherwise it will be returned as a float.
锟芥本 | 说锟斤拷 |
---|---|
4.2.0 |
锟斤拷锟斤拷锟斤拷芗锟斤拷锟斤拷荩锟斤拷锟斤拷锟斤拷锟揭伙拷锟斤拷锟斤拷妫�pow() 锟斤拷锟斤拷锟斤拷 FALSE 锟斤拷pow() 锟斤拷始锟斤拷锟斤拷锟斤拷锟轿何的撅拷锟芥。
|
4.0.6 | 锟斤拷锟斤拷锟斤拷芎锟斤拷锟斤拷锟斤拷诨岱碉拷锟� integer 锟侥斤拷锟斤拷锟街� 锟斤拷锟角凤拷锟斤拷 float锟斤拷For older versions, you may receive a bogus result for complex numbers. |
Example #1 pow() 锟斤拷一些锟斤拷锟斤拷
<?php
var_dump(pow(2, 8)); // int(256)
echo pow(-1, 20); // 1
echo pow(0, 0); // 1
echo pow(-1, 5.5); // PHP >4.0.6 NAN
echo pow(-1, 5.5); // PHP <=4.0.6 1.#IND
?>
Note:
锟斤拷锟斤拷锟斤拷锟斤拷转锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷为锟斤拷锟街o拷锟斤拷使锟角非憋拷锟斤拷值锟斤拷锟结导锟铰癸拷锟斤拷模锟�weird锟斤拷锟斤拷锟斤拷锟�