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

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

hugsbrugs/php-math
==================

PHP Math Utilities

04PHP

Since Apr 19Pushed 7y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

php-math
========

[](#php-math)

This librairy provides utilities function to ease math &amp; stats

[![Build Status](https://camo.githubusercontent.com/96bcaa8477aa4fcb4af773700c382a9096df4f1ed1190463f6d2763305cd2bde/68747470733a2f2f7472617669732d63692e6f72672f6875677362727567732f7068702d6d6174682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/hugsbrugs/php-math)[![Coverage Status](https://camo.githubusercontent.com/bca84a442920c41787446ffc4c949c3538f05cc5c749cdb21b4c8eefdc984cad/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6875677362727567732f7068702d6d6174682f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/hugsbrugs/php-math?branch=master)

Install
-------

[](#install)

Install package with composer

```
composer require hugsbrugs/php-math

```

In your PHP code, load library

```
require_once __DIR__ . '/../vendor/autoload.php';
use Hug\Math\Math as Math;
```

Usage
-----

[](#usage)

Return modulo of a number given a divider

```
Math::modulo($nb, $divider);
```

Compute Dice Coefficient for 2 given texts

```
Math::dice($str1 = '', $str2 = '');
```

Unit Tests
----------

[](#unit-tests)

```
phpunit --bootstrap vendor/autoload.php test

```

Author
------

[](#author)

Hugo Maugey [visit my website ;)](https://hugo.maugey.fr)

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

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/cc04033020c3e5219ac30edf7d7362952e88ea64a0de2f41b89559f849f09901?d=identicon)[hugsbrugs](/maintainers/hugsbrugs)

---

Top Contributors

[![hugsbrugs](https://avatars.githubusercontent.com/u/4385090?v=4)](https://github.com/hugsbrugs "hugsbrugs (3 commits)")

---

Tags

dicemathmodulophp

### Embed Badge

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

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

###  Alternatives

[frowhy/mini-program-aes

PHP 7.1 微信小程序加密解密算法

1021.5k](/packages/frowhy-mini-program-aes)[ournameismud/fractal

Custom Fractal plugin

148.7k1](/packages/ournameismud-fractal)

PHPackages © 2026

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