BcMath\Number is one of those classes that overloads boolean casting.
If $z = new BcMath\Number(0) then $z is considered falsy (and hence, for example, empty($z)==true) even though it is a genuine Number object.
(PHP 8 >= 8.4.0)
Uma classe para número de precisão arbitrária. Estes objetos suportam sobrecarga de operadores aritméticos e comparativos.
Nota: Esta classe não é afetada pela diretiva INI bcmath.scale definida no php.ini.
Nota: O comportamento de um operador sobrecarregado é o mesmo que especificar
null
para o parâmetroscale
no método correspondente.
$exponent
, BcMath\Number|string|int $modulus
, ?int $scale
= null
): BcMath\Number$precision
= 0, RoundingMode $mode
= RoundingMode::HalfAwayFromZero): BcMath\Numberscale
tenha sido definido no método de cálculo.
BcMath\Number is one of those classes that overloads boolean casting.
If $z = new BcMath\Number(0) then $z is considered falsy (and hence, for example, empty($z)==true) even though it is a genuine Number object.