PHPackages                             wells5609/decimal - 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. wells5609/decimal

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

wells5609/decimal
=================

Library built atop the Decimal and Datastructures PHP extensions

00PHP

Since Mar 17Pushed 7y ago1 watchersCompare

[ Source](https://github.com/wells5609/Xpl.Decimal)[ Packagist](https://packagist.org/packages/wells5609/decimal)[ RSS](/packages/wells5609-decimal/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Xpl.Decimal
===========

[](#xpldecimal)

Library built atop the `ds` and `decimal` PHP extensions.

**Namespace**: `Xpl\Decimal`

**Dependencies**:

- wells5609\\datetime
- `ds` extension
- `decimal` extension
- php &gt;= 7.3

---

**`Vector`** (*class*)
----------------------

[](#vector-class)

A strict implementation of `Ds\Sequence` that restricts values to `Decimal\Decimal` instances.

Has additional methods for doing common math operations - most are self-explanatory:

**`min(): Decimal`**

**`max(): Decimal`**

**`sum(): Decimal`**

**`mean(): Decimal`**

**`prod(): Decimal`**

**`delta(): Vector`**

Returns a vector containing the difference between each value (i.e. `$this[i] - $this[i-1]`).

**`rdelta(): Vector`**

Returns a vector containing the difference between each value as a percent (i.e. `($this[i] - $this[i-1]) / $this[i-1]`)

**`diff(Vector $y): Vector`**

Returns a vector containing the difference between each value in `$this` and `$y` (i.e. `$this[i] - $y[i]`)

**`var(): Decimal`**

Variance

**`covar(): Decimal`**

Covariance

**`stdev(): Decimal`**

Standard deviation

**`coefficientOfVariation(): Decimal`**

Coefficient of variation (aka relative standard deviation)

**`indexOfDispersion(): Decimal`**

Index of dispersion (aka relative variance)

**`correl(Vector $y): Decimal`**

Pearson's correlation coefficient (aka Pearson-product-moment correlation coefficient, "Pearson's r")

**`varp(): Decimal`**

Variance, treating the data as a population

**`stdevp(): Decimal`**

Standard deviation, treating the data as a population

**`centralMoment(int $k, bool $sample = true): Decimal`**

Central moment of the power `$k`

**`skewness(): Decimal`**

**`regressionSumOfSquares($ybar): Decimal`**

**`residualSumOfSquares(Vector $y): Decimal`**

**`totalSumOfSquares(Vector $y): Decimal`**

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

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/2b5b7d38d1408fa7abf81c2650415faa6d135c0725b5a25c5e52aefeac03c455?d=identicon)[wells5609](/maintainers/wells5609)

---

Top Contributors

[![wells5609](https://avatars.githubusercontent.com/u/4088444?v=4)](https://github.com/wells5609 "wells5609 (11 commits)")

### Embed Badge

![Health badge](/badges/wells5609-decimal/health.svg)

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

###  Alternatives

[leandrocfe/filament-ptbr-form-fields

Brazilian pt-BR form fields.

14398.7k](/packages/leandrocfe-filament-ptbr-form-fields)

PHPackages © 2026

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