php -- 数学函数
2014-05-24 21:12
211 查看
----- 016-math.php -----
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>数学函数测试</title> </head> <body> <h3>数学函数测试</h3> <pre> <?php echo "-2.7的绝对值:", abs(-2.7), "\n"; echo "2.4取FLOOR:", floor(2.4), "\n"; echo "2.4取ROUND:", round(2.4), "\n"; echo "2.4取CEIL:", ceil(2.4), "\n"; echo "1023换二进制:", decbin(1023), "\n"; echo "1和0.9哪个大:", max(1, 0.9), "\n"; echo "2的30次方:", pow(2, 30), "\n"; echo "1到2随机数10次:\n"; for($i=0; $i<10; $i++) echo rand(1, 2), "\t\n"; echo "取2的开方:", sqrt(2), "\n"; ?> </pre> </body> </html>
相关文章推荐
- 学习PHP几个数学计算的隔膜泵内部函数
- PHP几个数学计算的内部函数学习整理
- php数学运算函数库
- PHP数学运算函数大汇总(经典值得收藏)
- PHP数学运算函数大汇总(经典值得收藏)
- php中BC math 高精度数学函数
- php日期时间函数和数学函数
- php常用数学函数汇总
- php 数学函数
- 学习PHP几个数学计算的内部函数
- 函数返回PHP 常用数学计算内部函数 (Mathematical Functions)
- PHP 常用数学计算内部函数 (Mathematical Functions)
- php常用数学函数汇总
- PHP常用函数(数学函数)
- PHP几个数学计算的内部函数学习整理
- php数学函数
- php学习之数学函数 数字运算 随机数 数组
- php学习基础篇之基础函数(数学 日期 字符串)、php循环流程控制
- 前端PHP入门-019-内置函数之数学函数-很重要