nickolasburr / floatcmp
Compare floating-point numbers with optional precision.
1.0.2
2022-06-14 05:30 UTC
Requires
- php: ^7.1||^8.0
Suggests
- ext-bcmath: Provides bccomp function
This package is auto-updated.
Last update: 2024-04-17 01:19:14 UTC
README
Description
Compare floating-point numbers with optional precision.
Installation
composer require nickolasburr/floatcmp:~1.0
Usage
$a = 0.00528690;
$b = 0.00528;
if (floatcmp($a, $b, 5) === 0) {
/* $a and $b are equal at given precision */
}