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)
A class for an arbitrary precision number. These objects support overloaded arithmetic and comparison operators.
Note: This class is not affected by the bcmath.scale INI directive set in php.ini.
Note: The behavior of an overloaded operator is the same as specifying
null
for thescale
parameter on the corresponding method.
$exponent
, BcMath\Number|string|int $modulus
, ?int $scale
= null
): BcMath\Number$precision
= 0, RoundingMode $mode
= RoundingMode::HalfAwayFromZero): BcMath\Numberscale
parameter was set in the calculation method.
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.
Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!
Check out: eBank.nz (Art Generator) |
Netwrck.com (AI Tools) |
Text-Generator.io (AI API) |
BitBank.nz (Crypto AI) |
ReadingTime (Kids Reading) |
RewordGame |
BigMultiplayerChess |
WebFiddle |
How.nz |
Helix AI Assistant