您现在的位置是:首页 > PHP函数

李清波 2021-08-09 PHP函数 1634 复制当前网址

bccomp

语法: int bccomp(string left operand, string right operand, int [scale]);

返回值: 整数

函数种类: 数学运算


解析:

此函数比较二个高精确度的数字。

输入二个字符串

若二个字符串一样大则返回 0;

若左边的数字字符串 (left operand) 比右边 (right operand) 的大则返回 +1;

若左边的数字字符串比右边的小则返回 -1。


scale 是一个可有可无的选项,表示返回值的小数点后所需的位数。


文章来源:https://www.liqingbo.com/blog-1759.html

上一篇:rsort

下一篇:password_hash

评论