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)
任意精度数値のクラスです。 このオブジェクトは、オーバーロードされた 算術演算子, 比較演算子 をサポートしています。
注意: このクラスは、php.iniで設定された bcmath.scale INI ディレクティブの影響を受けません。
注意: オーバーロードされた演算子の動作は、対応するメソッドで
scale
パラメータにnull
を指定した場合と同じです。
$exponent
, BcMath\Number|string|int $modulus
, ?int $scale
= null
): BcMath\Number$precision
= 0, RoundingMode $mode
= RoundingMode::HalfAwayFromZero): BcMath\Numberscale
パラメータが設定されていない場合、
この値は自動的に計算されて設定されます。
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.