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

ActiveLibrary

webit/bcmath
============

Object wrapper for PHP BcMath Library

2.0.2(4y ago)1761.7k↓25%63MITPHPPHP &gt;=7.1CI failing

Since May 9Pushed 4y ago3 watchersCompare

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

READMEChangelog (4)Dependencies (1)Versions (10)Used By (3)

Object wrapper for PHP BcMath Library
=====================================

[](#object-wrapper-for-php-bcmath-library)

This library provides immutable representation of **BcMath** number supporting all **BcMath** extension operations (see [http://php.net/manual/en/book.bc.php](http://php.net/manual/en/book.bc.php "BC PHP extension documentation"))

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

[](#installation)

Composer: add the **webit/bcmath** into **composer.json**

```
{
    "require": {
        "php": ">=7.1.0",
        "webit/bcmath": "^2.0.0"
    }
}
```

Usage
-----

[](#usage)

```
    $num = new BcMathNumber('123.1233');
    $result = $num->add('13.22')->mul('3.05');
    echo $result . "\n";
```

Release note
------------

[](#release-note)

This version 2.0 breaks a backward compatibility. Since now **BcMathNumber**:

- is marked `final`
- constants are marked `private`
- works only for PHP &gt;= 7.1

Version 1.1 breaks a backward compatibility. Since now **BcMathNumber**:

- is immutable (removed *setValue* method)
- has no instance property *scale* (removed instance methods *getScale* / *setScale*) as number itself can't have a *scale*

To use previous version see tag 1.0.0 [https://github.com/dbojdo/bcmath/tree/1.0.0](https://github.com/dbojdo/bcmath/tree/1.0.0 "Tag 1.0.0")

Tests
-----

[](#tests)

```
docker-compose run --rm src composer install
docker-compose run --rm phpunit
```

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 57.1% 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 ~348 days

Recently: every ~361 days

Total

8

Last Release

1589d ago

Major Versions

1.x-dev → 2.0.02020-02-12

PHP version history (2 changes)1.0.0PHP &gt;=5.3.3

2.0.0PHP &gt;=7.1

### Community

Maintainers

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

---

Top Contributors

[![dbojdo](https://avatars.githubusercontent.com/u/1272416?v=4)](https://github.com/dbojdo "dbojdo (4 commits)")[![fyrye](https://avatars.githubusercontent.com/u/302306?v=4)](https://github.com/fyrye "fyrye (1 commits)")[![Invis1ble](https://avatars.githubusercontent.com/u/1710944?v=4)](https://github.com/Invis1ble "Invis1ble (1 commits)")[![voku](https://avatars.githubusercontent.com/u/264695?v=4)](https://github.com/voku "voku (1 commits)")

---

Tags

bcmathbig numeric

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[phpseclib/bcmath_compat

PHP 5.x-8.x polyfill for bcmath extension

16720.7M17](/packages/phpseclib-bcmath-compat)[krowinski/bcmath-extended

Extends php BCMath lib for missing functions like floor, ceil, round, abs, min, max, rand for big numbers. Also wraps existing BCMath functions. (more http://php.net/manual/en/book.bc.php) Supports scientific notations

791.0M19](/packages/krowinski-bcmath-extended)[prestashop/decimal

Object-oriented wrapper/shim for BC Math PHP extension. Allows for arbitrary-precision math operations.

178.2M5](/packages/prestashop-decimal)[ulabox/money

Yet another PHP implementation of the Money value object using BCMath

77238.1k](/packages/ulabox-money)[ionux/phactor

Phactor is a high-performance PHP implementation of the elliptic curve math functions required to generate &amp; verify private/public (asymmetric) EC keypairs and ECDSA signatures based on secp256k1 curve parameters. This library also includes a class to generate Service Identification Numbers (SINs) based on the published Identity Protocol v1 spec.

5275.0k30](/packages/ionux-phactor)[rtlopez/decimal

An object oriented immutable arbitrary-precision arithmetic library for PHP

27262.8k2](/packages/rtlopez-decimal)

PHPackages © 2026

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