php数学函数,加(bcadd)、减(bcsub)、乘(bcmul)、除(bcdiv)

bcscale() 来设置全局默认的小数位数

bcscale ( int $scale ) : bool

设置所有bc数学函数的未设定情况下得小数点保留位数.

php数学函数,加(bcadd)、减(bcsub)、乘(bcmul)、除(bcdiv)_第1张图片

bcadd — 2个任意精度数字的加法计算

左操作数和右操作数求和 ,scale 用于设置结果中小数点后的小数位数。

bcadd ( string $left_operand , string $right_operand [, int $scale ] ) : string


bccomp — 比较两个任意精度的数字

bccomp ( string $left_operand , string $right_operand [, int $scale = int ] ) : int


bcdiv — 2个任意精度的数字除法计算

bcdiv ( string $left_operand , string $right_operand [, int $scale = int ] ) : string


bcmod — 对一个任意精度数字取模

bcmod ( string $left_operand , string $modulus ) : string


bcmul — 2个任意精度数字乘法计算

bcmul ( string $left_operand , string $right_operand [, int $scale = int ] ) : string


bcpow — 任意精度数字的乘方

bcpow ( string $left_operand , string $right_operand [, int $scale ] ) : string


bcpowmod----将任意的精确数提高到另一个,再用指定的模量还原

bcpowmod ( string $base , string $exponent , string $modulus [, int $scale = 0 ] ) : string


bcscale — 设置所有bc数学函数的默认小数点保留位数

bcscale ( int $scale ) : bool

bcsqrt — 任意精度数字的二次方根

bcsqrt ( string $operand [, int $scale ] ) : string


bcsub — 2个任意精度数字的减法

bcsub ( string $left_operand , string $right_operand [, int $scale = int ] ) : string

你可能感兴趣的:(PHP)