Download the PHP package nickolasburr/floatcmp without Composer
On this page you can find all versions of the php package nickolasburr/floatcmp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download nickolasburr/floatcmp
More information about nickolasburr/floatcmp
Files in nickolasburr/floatcmp
Download nickolasburr/floatcmp
More information about nickolasburr/floatcmp
Files in nickolasburr/floatcmp
Vendor nickolasburr
Package floatcmp
Short Description Compare floating-point numbers with optional precision.
License MIT
Package floatcmp
Short Description Compare floating-point numbers with optional precision.
License MIT
Please rate this library. Is it a good library?
Informations about the package floatcmp
floatcmp
:local:
Description
Compare floating-point numbers with optional precision.
Installation
composer require nickolasburr/floatcmp:^1.0
Usage
use function floatcmp;
$a = 0.00528690;
$b = 0.00528;
if (floatcmp($a, $b, 5) === 0) {
/*
* $a and $b are equal at given scale precision.
*
* Unlike a floating-point arithmetic library,
* floatcmp() does not apply rounding to its
* arguments but instead takes a fixed-width
* scale approach like bccomp(). When bcmath
* is available, floatcmp() will use bccomp()
* for the float comparison.
*/
}
All versions of floatcmp with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.1
The package nickolasburr/floatcmp contains the following files
Loading the files please wait ...