bcscale() 来设置全局默认的小数位数
bcscale ( int $scale ) : bool
设置所有bc数学函数的未设定情况下得小数点保留位数.

bcadd — 2个任意精度数字的加法计算
左操作数和右操作数求和 ,scale 用于设置结果中小数点后的小数位数。
bcadd ( string $left_operand , string $right_operand [, int $scale ] ) : string
|
1 2 3 4 5 6 |
|
bccomp — 比较两个任意精度的数字
bccomp ( string $left_operand , string $right_operand [, int $scale = int ] ) : int
|
1 2 3 4 |
|
bcdiv — 2个任意精度的数字除法计算
bcdiv ( string $left_operand , string $right_operand [, int $scale = int ] ) : string
|
1 2 3 4 5 6 7 |
|
bcmod — 对一个任意精度数字取模
bcmod ( string $left_operand , string $modulus ) : string
|
1 2 3 4 |
|
bcmul — 2个任意精度数字乘法计算
bcmul ( string $left_operand , string $right_operand [, int $scale = int ] ) : string
|
1 2 3 4 |
|
bcpow — 任意精度数字的乘方
bcpow ( string $left_operand , string $right_operand [, int $scale ] ) : string
|
1 2 3 |
|
bcpowmod----将任意的精确数提高到另一个,再用指定的模量还原
bcpowmod ( string $base , string $exponent , string $modulus [, int $scale = 0 ] ) : string
|
1 2 3 4 5 |
|
bcscale — 设置所有bc数学函数的默认小数点保留位数
bcscale ( int $scale ) : bool
|
1 2 3 4 5 6 7 |
|
bcsqrt — 任意精度数字的二次方根
bcsqrt ( string $operand [, int $scale ] ) : string
|
1 2 3 |
|
bcsub — 2个任意精度数字的减法
bcsub ( string $left_operand , string $right_operand [, int $scale = int ] ) : string
|
1 2 3 4 5 6 |
|
这篇文章介绍了PHP的bcmath扩展,它提供了一组函数用于进行任意精度的数学运算,如加法(bcadd),比较(bccomp),除法(bcdiv),取模(bcmod),乘法(bcmul),乘方(bcpow)以及减法(bcsub)。bcscale函数用于设置全局小数位数,影响所有bcmath函数的结果精度。
1198

被折叠的 条评论
为什么被折叠?



