PHPackages                             masum-packagist/php-math-operations - 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. masum-packagist/php-math-operations

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

masum-packagist/php-math-operations
===================================

A PHP package for any kind of Math Operations.

1.0.0(1y ago)05MITPHP

Since Oct 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/masumsoftdev/php-math-operations)[ Packagist](https://packagist.org/packages/masum-packagist/php-math-operations)[ RSS](/packages/masum-packagist-php-math-operations/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

MathOperations PHP Library
==========================

[](#mathoperations-php-library)

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://opensource.org/licenses/MIT)

Introduction
------------

[](#introduction)

`MathOperations` is a PHP library that provides a comprehensive set of mathematical operations, from basic arithmetic and trigonometry to logarithmic, permutation/combination, and random number generation. This library is designed for developers who need quick and easy access to a variety of math functions in their PHP projects.

Features
--------

[](#features)

- Basic arithmetic: addition, subtraction, multiplication, division, modulus, power, square root
- Exponential and logarithmic functions
- Trigonometric functions (radians) and inverse trigonometric functions
- Hyperbolic functions
- Degree and radian conversions
- Rounding and absolute functions
- Min, max, and average calculations
- Factorial, GCD (greatest common divisor), and LCM (least common multiple)
- Permutations and combinations
- Random number generation
- Sum and product of arrays
- Pythagorean theorem calculation

Requirements
------------

[](#requirements)

- PHP 7.4 or higher

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

[](#installation)

You can install this package via [Composer](https://getcomposer.org/).

1. First, install Composer if you haven't already:

    ```
    curl -sS https://getcomposer.org/installer | php
    mv composer.phar /usr/local/bin/composer
    ```
2. Install the `MathOperations` library by running:

    ```
    composer require masum-packagist/php-math-operations
    ```

This will install the package and its dependencies into your PHP project.

Usage
-----

[](#usage)

After installing, you can include the library in your project like this:

```
