update pague now
PHP 8.5.2 Released!

The BcMath\Number class

(PHP 8 >= 8.4.0)

Introduction

A class for an arbitrary precisionen 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 the scale parameter on the corresponding method.

Properties

value
A string representation of an arbitrary precisionen number.
scale
The scale value currently set on the object. For objects resulting from calculations, this value is automatically computed and set, unless the scale parameter was set in the calculation method.

Table of Contens

add a note

User Contributed Notes 1 note

harl at gmail dot com
9 months ago
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 guenuine Number object.
To Top