PHPackages                             bradietilley/bcmath-number - 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. bradietilley/bcmath-number

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

bradietilley/bcmath-number
==========================

Simulating the upcoming BCMath\\Number class

v0.0.4(2y ago)217[1 PRs](https://github.com/bradietilley/bcmath-number/pulls)MITPHPPHP ^8.2

Since May 11Pushed 1y ago1 watchersCompare

[ Source](https://github.com/bradietilley/bcmath-number)[ Packagist](https://packagist.org/packages/bradietilley/bcmath-number)[ RSS](/packages/bradietilley-bcmath-number/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (4)Versions (6)Used By (0)

BCMath Number
=============

[](#bcmath-number)

A drop-in replacement for the upcoming `BCMath\Number` object type in PHP 8.4

[![Static Analysis](https://github.com/bradietilley/bcmath-number/actions/workflows/static.yml/badge.svg)](https://github.com/bradietilley/bcmath-number/actions/workflows/static.yml/badge.svg)[![Tests](https://github.com/bradietilley/bcmath-number/actions/workflows/tests.yml/badge.svg)](https://github.com/bradietilley/bcmath-number/actions/workflows/tests.yml/badge.svg)

Introduction
------------

[](#introduction)

The `BCMath\Number` object type is not yet confirmed ([RFC](https://php.watch/rfcs/support_object_type_in_bcmath)). It is also unclear about the exact implementation deatils so this package is not a perfect replica however I've aimed to achieve an exact alternative to `BCMath\Number` not necessarily as a backwards-compatible polyfill or shim but to be used as dependency before `BCMath\Number` is available.

This package is available as `BradieTilley\BCMath\Number` and, until PHP 8.4, `BCMath\Number`.

Installation
------------

[](#installation)

```
composer require bradietilley/bcmath-number

```

Documentation
-------------

[](#documentation)

Refer to the [RFC](https://php.watch/rfcs/support_object_type_in_bcmath) for general usage examples. The gist of it is:

```
use BCMath\Number; // or use BradieTilley\BCMath\Number;

$number = new Number('34.465');
$result = $number->add('76.2');

echo (string) $result; // 110.665

// Number class is immutable so the original $number value remains. Resulting value are returned in a new object.
echo (string) $number; // 34.465
```

Author
------

[](#author)

- [Bradie Tilley](https://github.com/bradietilley)
- [Owen Voke](https://github.com/owenvoke)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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 ~0 days

Total

4

Last Release

731d ago

### Community

Maintainers

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

---

Top Contributors

[![bradietilley](https://avatars.githubusercontent.com/u/44430471?v=4)](https://github.com/bradietilley "bradietilley (16 commits)")[![owenvoke](https://avatars.githubusercontent.com/u/1899334?v=4)](https://github.com/owenvoke "owenvoke (4 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/bradietilley-bcmath-number/health.svg)

```
[![Health](https://phpackages.com/badges/bradietilley-bcmath-number/health.svg)](https://phpackages.com/packages/bradietilley-bcmath-number)
```

PHPackages © 2026

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