PHP-Number
2016-07-20 21:36:27 0 举报
AI智能生成
PHP-Number是一个用于处理数字的扩展库,它提供了一组丰富的函数和类来操作各种数字类型。这个库支持整数、浮点数、复数等不同类型的数字,并提供了各种数学运算、比较、格式化等功能。通过使用PHP-Number,开发人员可以轻松地执行复杂的数学计算,而无需编写大量的代码。此外,PHP-Number还提供了一些实用的工具类,如大数运算、素数检测等,可以方便地进行高级数学运算。总之,PHP-Number是一个功能强大、易于使用的扩展库,为PHP开发人员提供了处理数字的便利工具。
作者其他创作
大纲/内容
指数幂
exp($arg);
pow($base, $arg);
格式化
number_format($number, $decimals);
money_format();
setlocale();
打印复数
print "total numbers:". ($number == 1 ? 'person' : 'people');
三角函数
sin()
cos()
tan()
deg2rad();rad2deg();
数字类型判断函数
is_numeric($var);
is_float()、is_double()、is_real()
is_int()、is_integer()、is_long()
浮点数取整
round($num, $precision);
ceil($num);
floor($num);
生成随机数
rand($start, $end);
mt_rand($start, $end);
取对数
log10($arg);
log($arg, $base);
进制转换函数
base_convert($number, $frombase, $tobase);
bindec();
decbin();
octdec();
decoct();
hexdec();
dechex();
0 条评论
下一页