37 public function add($left_operand, $right_operand, ?
int $scale =
null)
45 public function sub($left_operand, $right_operand, ?
int $scale =
null)
53 public function mul($left_operand, $right_operand, ?
int $scale =
null)
61 public function div($left_operand, $right_operand, ?
int $scale =
null)
63 if ($right_operand == 0) {
73 public function mod($left_operand, $right_operand)
75 if ($right_operand == 0) {
85 public function pow($left_operand, $right_operand, ?
int $scale =
null)
87 $left_operand = $this->
normalize($left_operand);
88 $right_operand = $this->
normalize($right_operand);
94 $left_operand_dec = $this->
exp2dec($left_operand);
95 $right_operand_dec = $this->
exp2dec($right_operand);
98 if (strpos($right_operand_dec,
'.') ===
false) {
99 return bcpow($left_operand_dec, $right_operand_dec, $scale);
102 return $this->
applyScale($left_operand ** $right_operand, $scale);
108 public function sqrt($operand, ?
int $scale =
null)
110 return bcsqrt($operand, $scale);
116 public function comp($left_operand, $right_operand, ?
int $scale =
null):
int
118 return bccomp($left_operand, $right_operand, $scale);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
comp($left_operand, $right_operand, ?int $scale=null)
@inheritDoc
mod($left_operand, $right_operand)
@inheritDoc
sqrt($operand, ?int $scale=null)
@inheritDoc
__construct($scale=0)
ilMathBcMathAdapter constructor.
add($left_operand, $right_operand, ?int $scale=null)
@inheritDoc
pow($left_operand, $right_operand, ?int $scale=null)
@inheritDoc
div($left_operand, $right_operand, ?int $scale=null)
@inheritDoc
mul($left_operand, $right_operand, ?int $scale=null)
@inheritDoc
sub($left_operand, $right_operand, ?int $scale=null)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
applyScale($left_operand, ?int $scale=null)
@inheritDoc
normalize($number)
This function fixes problems which occur when locale ist set to de_DE for example,...