PHPackages                             philipbrown/math - 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. philipbrown/math

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

philipbrown/math
================

A simple wrapper for BC Math

v2.0.1(11y ago)6361MITPHPPHP &gt;=5.4

Since Apr 20Pushed 11y ago1 watchersCompare

[ Source](https://github.com/philipbrown/math)[ Packagist](https://packagist.org/packages/philipbrown/math)[ RSS](/packages/philipbrown-math/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

Math
====

[](#math)

**A simple wrapper for BC Math**

[![Build Status](https://camo.githubusercontent.com/f68e8f3766ca837d7292645c8d1e9a58417255bc86b4e0b24c8250739a288bfa/68747470733a2f2f7472617669732d63692e6f72672f7068696c697062726f776e2f6d6174682e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/philipbrown/math)[![Code Coverage](https://camo.githubusercontent.com/87861f76192f04db239e0e7f570d2029dbbbca62916b267c92b28311a56d0ad0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7068696c697062726f776e2f6d6174682f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/philipbrown/math/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/d2d9ac9752304c5124f915f93afe454ba14af0061a57c357ce93969025b20f19/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7068696c697062726f776e2f6d6174682f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/philipbrown/math/?branch=master)

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

[](#installation)

Add `philipbrown/math` as a requirement to `composer.json`:

```
{
  "require": {
    "philipbrown/math": "~2.0"
  }
}
```

Update your packages with `composer update`.

Usage
-----

[](#usage)

```
use PhilipBrown\Math\Math;

/**
 * Add
 *
 * @param mixed $left
 * @param mixed $right
 * @param mixed $scale
 * @return PhilipBrown\Math\Number
 */
$number = Math::add(1.04, 2.406, 4);

/**
 * Compare
 *
 * @param mixed $left
 * @param mixed $right
 * @param mixed $scale
 * @return PhilipBrown\Math\Number
 */
$number = Math::compare(2.4567, 2.4566, 4);

/**
 * Divide
 *
 * @param mixed $left
 * @param mixed $right
 * @param mixed $scale
 * @return PhilipBrown\Math\Number
 */
$number = Math::divide(23.3945, 5, 4);

/**
 * Modulus
 *
 * @param mixed $operand
 * @param mixed $modulus
 * @return PhilipBrown\Math\Number
 */
$number = Math::modulus(10, 3);

/**
 * Multiply
 *
 * @param mixed $left
 * @param mixed $right
 * @param mixed $scale
 * @return PhilipBrown\Math\Number
 */
$number = Math::multiply(5.34, 2.2, 3);

/**
 * Power
 *
 * @param mixed $left
 * @param mixed $right
 * @param mixed $scale
 * @return PhilipBrown\Math\Number
 */
$number = Math::power(43.22, 2, 5);

/**
 * Square Root
 *
 * @param mixed $operand
 * @param mixed $scale
 * @return PhilipBrown\Math\Number
 */
$number = Math::squareRoot(454.213, 4);

/**
 * Subtract
 *
 * @param mixed $left
 * @param mixed $right
 * @param mixed $scale
 * @return PhilipBrown\Math\Number
 */
$number = Math::subtract(10.888, 2.123, 3);
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

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 ~83 days

Total

3

Last Release

4243d ago

Major Versions

v1.0.0 → v2.02014-09-30

PHP version history (2 changes)v1.0.0PHP &gt;=5.3.2

v2.0PHP &gt;=5.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/59881cd39ca687db95393603c2ccf65001d8173ed4d22eb1461f6b9242d53558?d=identicon)[philipbrown](/maintainers/philipbrown)

---

Top Contributors

[![philipbrown](https://avatars.githubusercontent.com/u/1579059?v=4)](https://github.com/philipbrown "philipbrown (77 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/philipbrown-math/health.svg)

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

###  Alternatives

[morilog/jalali

This Package helps developers to easily work with Jalali (Shamsi or Iranian) dates in PHP applications, based on Jalali (Shamsi) DateTime class.

9201.2M45](/packages/morilog-jalali)[bruli/php-git-hooks

Git hooks for PHP projects.

675370.8k5](/packages/bruli-php-git-hooks)[nikolaposa/version

Value Object that represents a SemVer-compliant version number.

1406.4M16](/packages/nikolaposa-version)[prooph/common

Common classes used across prooph packages

852.2M27](/packages/prooph-common)[funeralzone/valueobjects

A PHP 7.1 value objects helper library.

66643.3k22](/packages/funeralzone-valueobjects)[tomasnorre/crawler

Crawler extension for TYPO3

58397.5k1](/packages/tomasnorre-crawler)

PHPackages © 2026

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