PHPackages                             haeckel/basic-decimal-arithmetic - 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. haeckel/basic-decimal-arithmetic

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

haeckel/basic-decimal-arithmetic
================================

Simple interface for doing basic arithmetic with decimal numbers with arbitrary precision

014[1 PRs](https://github.com/dhaeckel/php-basic-decimal-arithmetic/pulls)PHPCI passing

Since Jan 7Pushed 3mo agoCompare

[ Source](https://github.com/dhaeckel/php-basic-decimal-arithmetic)[ Packagist](https://packagist.org/packages/haeckel/basic-decimal-arithmetic)[ RSS](/packages/haeckel-basic-decimal-arithmetic/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

[![codecov](https://camo.githubusercontent.com/7733e8d0ed86b422e692055816c7e915ec07ee57db3dc1c491a7afaccf89ea89/68747470733a2f2f636f6465636f762e696f2f67682f64686165636b656c2f7068702d62617369632d646563696d616c2d61726974686d657469632f67726170682f62616467652e7376673f746f6b656e3d334b5234505139453059)](https://codecov.io/gh/dhaeckel/php-basic-decimal-arithmetic)[![ci](https://github.com/dhaeckel/php-basic-decimal-arithmetic/actions/workflows/php.yml/badge.svg)](https://github.com/dhaeckel/php-basic-decimal-arithmetic/actions/workflows/php.yml)[![Static Badge](https://camo.githubusercontent.com/14995ff65edea59395c224e37e4fc66f91c1e601c1a58311e3c6f38c4fe37feb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c2532306d61782d627269676874677265656e)](phpstan.dist.neon)[![Static Badge](https://camo.githubusercontent.com/b4dd7de37447bf201a1b6bfa4758fb5e24cbf79eb4f9c412a7705ec1b17315bf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d7374726963745f72756c65732d627269676874677265656e)](https://camo.githubusercontent.com/b4dd7de37447bf201a1b6bfa4758fb5e24cbf79eb4f9c412a7705ec1b17315bf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d7374726963745f72756c65732d627269676874677265656e)[![Packagist License](https://camo.githubusercontent.com/590c38dd8ddb68ea7bfdea34654623b5afae5c05cf9393e2e6712e4dd00f623d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f686165636b656c2f657863657074696f6e)](https://camo.githubusercontent.com/590c38dd8ddb68ea7bfdea34654623b5afae5c05cf9393e2e6712e4dd00f623d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f686165636b656c2f657863657074696f6e)

Haeckel/php-basic-decimal-arithmetic
====================================

[](#haeckelphp-basic-decimal-arithmetic)

Simple php library for working with decimal numbers in arbitrary precision.

Features
--------

[](#features)

- Calculator interface the four basic arithmetic operations and modulo
- a type decimal num to encapsulate strings in decimal notation (main motivation was the bcmath required format)
- a cmpResult enum to have readable values for comparison results. Used by calculator, but may as well be used for e.g. strcmp

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

[](#installation)

Install the package vai composer by running:

```
composer require haeckel/exception
```

Contribute
----------

[](#contribute)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

[Source Code](https://github.com/dhaeckel/php-basic-decimal-arithmetic)

Support
-------

[](#support)

Let us know if you have issues.

[Issue Tracker](https://github.com/dhaeckel/php-basic-decimal-arithmetic/issues)

License
-------

[](#license)

[LGPL-3.0-or-later](COPYING.LESSER)

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance53

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/86be890d6b82e0a0048eeebc88672c30efa3ddc68982adfde0b54d8230d763dc?d=identicon)[dhaeckel](/maintainers/dhaeckel)

---

Top Contributors

[![dhaeckel](https://avatars.githubusercontent.com/u/65503128?v=4)](https://github.com/dhaeckel "dhaeckel (19 commits)")

### Embed Badge

![Health badge](/badges/haeckel-basic-decimal-arithmetic/health.svg)

```
[![Health](https://phpackages.com/badges/haeckel-basic-decimal-arithmetic/health.svg)](https://phpackages.com/packages/haeckel-basic-decimal-arithmetic)
```

###  Alternatives

[dantleech/glob-finder

Library offering object location from hierarchrical persistent storage systems using globs

551.4M3](/packages/dantleech-glob-finder)[jbzoo/mermaid-php

Generate diagrams and flowcharts with the help of the mermaid script language

471.1M6](/packages/jbzoo-mermaid-php)

PHPackages © 2026

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