PHPackages                             amitxd/libcalculator - 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. amitxd/libcalculator

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

amitxd/libcalculator
====================

A PHP calculator library with additional mathematical functions.

1.0.0(2y ago)05MITPHP

Since Sep 11Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Amitminer/libCalculator)[ Packagist](https://packagist.org/packages/amitxd/libcalculator)[ RSS](/packages/amitxd-libcalculator/feed)WikiDiscussions dev Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

libCalculator
=============

[](#libcalculator)

libCalculator is a simple PHP library for performing various mathematical calculations. It provides functions for basic arithmetic operations, as well as additional mathematical functions.

Features
--------

[](#features)

- Addition
- Subtraction
- Multiplication
- Division (with error handling for division by zero)
- Percentage calculation
- Exponentiation
- Square root
- Sine, cosine, and tangent calculations

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

[](#installation)

You can install this library via Composer:

```
composer require amitminer/libcalculator
```

Usage
-----

[](#usage)

```
use AmitxD\libCalculator\libCalculator;

$result1 = libCalculator::add(10, 10);
$result2 = libCalculator::subtract(10, 10);
$result3 = libCalculator::multiply(5, 10);
$result4 = libCalculator::divide(10, 5);
$result5 = libCalculator::percentage(25, 50);
$result6 = libCalculator::exponentiation(2, 3);
$result7 = libCalculator::squareRoot(25);
$result8 = libCalculator::sine(deg2rad(30));
$result9 = libCalculator::cosine(deg2rad(45));
$result10 = libCalculator::tangent(deg2rad(60));

echo "Addition: $result1\n";
echo "Subtraction: $result2\n";
echo "Multiplication: $result3\n";
echo "Division: $result4\n";
echo "Percentage: $result5\n";
echo "Exponentiation: $result6\n";
echo "Square Root: $result7\n";
echo "Sine: $result8\n";
echo "Cosine: $result9\n";
echo "Tangent: $result10\n";
```

Documentation
-------------

[](#documentation)

Detailed documentation for each function and class is available in the [Wiki](https://github.com/Amitminer/libCalculator/wiki).

License
-------

[](#license)

This library is open-source and licensed under the [MIT License](LICENSE.md).

Contributions
-------------

[](#contributions)

Contributions and bug reports are welcome! Please feel free to open issues or pull requests on the [GitHub repository](https://github.com/Amitminer/libCalculator).

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

979d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/71b228c053266fd03a4ddf8dbe27e8e047722948d36e0e907bbb8cb07a14d51a?d=identicon)[Amitminer](/maintainers/Amitminer)

---

Top Contributors

[![Amitminer](https://avatars.githubusercontent.com/u/81667979?v=4)](https://github.com/Amitminer "Amitminer (7 commits)")

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/amitxd-libcalculator/health.svg)

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

###  Alternatives

[askvortsov/flarum-auto-moderator

Powerful automation engine.

1418.4k2](/packages/askvortsov-flarum-auto-moderator)

PHPackages © 2026

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