PHPackages                             webit/complex-number - 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. webit/complex-number

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

webit/complex-number
====================

Web-IT Complex number wrapper

1.0.0(11y ago)03561PHPPHP &gt;=5.3.3

Since May 9Pushed 11y ago1 watchersCompare

[ Source](https://github.com/dbojdo/complex-number)[ Packagist](https://packagist.org/packages/webit/complex-number)[ RSS](/packages/webit-complex-number/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (1)

Web-IT Complex Number
=====================

[](#web-it-complex-number)

Object wrapper for Complex Number. Provides immutable Complex and ComplexArray classes. Supports operations like: adding, subtraction, multiplication, dividing, square root, absolute and multiplication by scalar value.

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

[](#installation)

### via Composer

[](#via-composer)

Add the **webit/complex-number** into **composer.json**

```
{
    "require": {
        "php": ">=5.3.2",
        "webit/complex-number": "~1.0"
    }
}
```

Usage
-----

[](#usage)

```
$num1 = new Complex(1, 3); // (real, imaginary)
// or
$num2 = Complex::create(5, 5);

$sum = $num1->add($num2);
$diff = $num1->sub($num2);
$prod = $num1->mul($num2);
$quot = $num1->div($num2);
$sqrt = $num1->sqrt();
$abs = $num1->abs(); // scalar
$conjugated = $num1->getConjugated();

$complexArray1 = new ComplexArray(array(23.4, 23.55)); // accepts array of floats or array of Complex
// or
$complexArray2 = ComplexArray::create(array(23.4, 23.55));

foreach ($complexArray1 as $complex) {
    echo $complex ."\n";
}
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

4027d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a6cc50814a7b150c2a02d719d33c6e11040a6d0d010b2f986a24794edce7f52f?d=identicon)[dbojdo](/maintainers/dbojdo)

---

Tags

complex number

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/webit-complex-number/health.svg)

```
[![Health](https://phpackages.com/badges/webit-complex-number/health.svg)](https://phpackages.com/packages/webit-complex-number)
```

PHPackages © 2026

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