PHP pow() 函数

PHP 教程 · 2019-01-27 08:42:46

实例

pow() 的实例:

<?php
echo(pow(2,4) . "<br>");
echo(pow(-2,4) . "<br>");
echo(pow(-2,-4) . "<br>");
echo(pow(-2,-3.2));
?>

定义和用法

pow() 函数返回 x 的 y 次方。

语法

pow(x,y);

参数 描述
x 必需。规定要使用的底。
y 必需。规定指数。

技术细节

返回值: x 的 y 次方。
返回类型: 如果可能则返回 Integer,否则返回 Float。
PHP 版本: 4+
PHP 更新日志: PHP 4.0.6:如果可能则返回 integer。之前的版本只返回 float。
PHP 4.2.0:如果发生错误则不产生任何的警告。

点击查看所有 PHP 教程 文章: https://www.codercto.com/courses/l/5.html

查看所有标签

Learning JavaScript

Learning JavaScript

Shelley Powers / Oreilly & Associates Inc / 2006-10-17 / $29.99

As web browsers have become more capable and standards compliant, JavaScript has grown in prominence. JavaScript lets designers add sparkle and life to web pages, while more complex JavaScript has led......一起来看看 《Learning JavaScript》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具