Download the PHP package masum-packagist/php-math-operations without Composer
On this page you can find all versions of the php package masum-packagist/php-math-operations. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download masum-packagist/php-math-operations
More information about masum-packagist/php-math-operations
Files in masum-packagist/php-math-operations
Package php-math-operations
Short Description A PHP package for any kind of Math Operations.
License MIT
Informations about the package php-math-operations
MathOperations PHP Library
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
- 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
- PHP 7.4 or higher
Installation
You can install this package via Composer.
-
First, install Composer if you haven't already:
- Install the
MathOperations
library by running:
This will install the package and its dependencies into your PHP project.
Usage
After installing, you can include the library in your project like this:
Basic Arithmetic
Exponential and Logarithmic Functions
Trigonometric Functions (input in radians)
Degree and Radian Conversions
Rounding and Absolute Functions
Factorial, GCD, and LCM
Permutations and Combinations
Random Number Generation
Sum and Product of Arrays
Pythagorean Theorem
Testing
To run the tests, you can use PHPUnit. First, install PHPUnit via Composer:
Then, you can run the tests using:
Ensure that your tests are located in the tests/
folder.
Contributing
If you would like to contribute to this library, feel free to submit a pull request on GitHub.
Please make sure all contributions adhere to the following guidelines:
- Write clear, concise commit messages.
- Ensure code follows PSR-12 coding standards.
- Include tests for new functionality.
- Document new methods and classes.
License
This package is open-sourced software licensed under the MIT license.