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

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

macfja/math
===========

A set of tools around Mathematics.

18PHP

Since Oct 3Pushed 10y ago1 watchersCompare

[ Source](https://github.com/MacFJA/Math)[ Packagist](https://packagist.org/packages/macfja/math)[ RSS](/packages/macfja-math/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Math library
============

[](#math-library)

A set of class and function around Mathematics.

What inside ?
-------------

[](#what-inside-)

### CombinationBuilder

[](#combinationbuilder)

An utility class to create combination. The class also provide a factorial calculation.

Example and Usage
-----------------

[](#example-and-usage)

### Combination

[](#combination)

Get for 3 in 5:

```
print_r(CombinationBuilder::getCombination(5, 3));
```

Will output:

```
Array
(
    [1-2-3] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 3
        )

    [1-2-4] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 4
        )

    [1-2-5] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 5
        )

    [1-3-4] => Array
        (
            [0] => 1
            [1] => 3
            [2] => 4
        )

    [1-3-5] => Array
        (
            [0] => 1
            [1] => 3
            [2] => 5
        )

    [1-4-5] => Array
        (
            [0] => 1
            [1] => 4
            [2] => 5
        )

    [2-3-4] => Array
        (
            [0] => 2
            [1] => 3
            [2] => 4
        )

    [2-3-5] => Array
        (
            [0] => 2
            [1] => 3
            [2] => 5
        )

    [2-4-5] => Array
        (
            [0] => 2
            [1] => 4
            [2] => 5
        )

    [3-4-5] => Array
        (
            [0] => 3
            [1] => 4
            [2] => 5
        )

)

```

Or in a more compact way:

```
(1, 2, 3)
(1, 2, 4)
(1, 2, 5)
(1, 3, 4)
(1, 3, 5)
(1, 4, 5)
(2, 3, 4)
(2, 3, 5)
(2, 4, 5)
(3, 4, 5)

```

### Combination Count

[](#combination-count)

Get the number of possible combination

```
print_r(CombinationBuilder::getCombinationCount(5, 3));

```

Will output:

```
10

```

### Factorial

[](#factorial)

Get the factorial of 5 (`5!`)

```
print_r(CombinationBuilder::factorial(5));

```

Will output:

```
120

```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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://avatars.githubusercontent.com/u/1475671?v=4)[MacFJA](/maintainers/MacFJA)[@MacFJA](https://github.com/MacFJA)

---

Top Contributors

[![MacFJA](https://avatars.githubusercontent.com/u/1475671?v=4)](https://github.com/MacFJA "MacFJA (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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