pow

(PHP 4, PHP 5, PHP 7)

pow指锟斤拷锟斤拷锟绞�

说锟斤拷

pow ( number $base , number $exp ) : number

锟斤拷锟斤拷 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(28)); // int(256)
echo pow(-120); // 1
echo pow(00); // 1

echo pow(-15.5); // PHP >4.0.6  NAN
echo pow(-15.5); // PHP <=4.0.6 1.#IND
?>

注锟斤拷

Note:

锟斤拷锟斤拷锟斤拷锟斤拷转锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷为锟斤拷锟街o拷锟斤拷使锟角非憋拷锟斤拷值锟斤拷锟结导锟铰癸拷锟斤拷模锟�weird锟斤拷锟斤拷锟斤拷锟�

锟轿硷拷

  • exp() - 锟斤拷锟斤拷 e 锟斤拷指锟斤拷
  • sqrt() - 平锟斤拷锟斤拷
  • bcpow() - 锟斤拷锟解精锟斤拷锟斤拷锟街的乘凤拷
  • gmp_pow() - Raise number into power