PHPackages                             nickolasburr/floatcmp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. nickolasburr/floatcmp

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nickolasburr/floatcmp
=====================

Compare floating-point numbers with optional precision.

1.1.0(1y ago)3181MITPHPPHP ^8.1

Since Feb 16Pushed 1y ago1 watchersCompare

[ Source](https://github.com/nickolasburr/floatcmp)[ Packagist](https://packagist.org/packages/nickolasburr/floatcmp)[ RSS](/packages/nickolasburr-floatcmp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (6)Used By (0)

floatcmp
========

[](#floatcmp)

- [Description](#description)
- [Installation](#installation)
- [Usage](#usage)

[Description](#id1)
-------------------

[](#description)

Compare floating-point numbers with optional precision.

[Installation](#id2)
--------------------

[](#installation)

```
composer require nickolasburr/floatcmp:^1.0
```

[Usage](#id3)
-------------

[](#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.
     */
}
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance44

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~274 days

Total

5

Last Release

455d ago

PHP version history (2 changes)1.0.0PHP ^7.1||^8.0

1.1.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/e186fc7828ee90af297839392dc98740ca74f302d7f462afd0ffe8c1d5841ace?d=identicon)[nickolasburr](/maintainers/nickolasburr)

---

Top Contributors

[![nickolasburr](https://avatars.githubusercontent.com/u/4663695?v=4)](https://github.com/nickolasburr "nickolasburr (25 commits)")

---

Tags

floating-pointphp

### Embed Badge

![Health badge](/badges/nickolasburr-floatcmp/health.svg)

```
[![Health](https://phpackages.com/badges/nickolasburr-floatcmp/health.svg)](https://phpackages.com/packages/nickolasburr-floatcmp)
```

###  Alternatives

[rlanvin/php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

69810.6M39](/packages/rlanvin-php-rrule)[mixpanel/mixpanel-php

The Official PHP library for Mixpanel

14216.0M24](/packages/mixpanel-mixpanel-php)[skleeschulte/base32

Base32 encoding and decoding class (RFC 4648, RFC 4648 extended hex, Crockford, z-base-32/Zooko).

17314.5k9](/packages/skleeschulte-base32)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
