https://github.com/josecelano/php-complex
PHP Complex class implemented with arbitrary-precision decimal arithmetic
https://github.com/josecelano/php-complex
arbitrary-precision complex php
Last synced: 2 months ago
JSON representation
PHP Complex class implemented with arbitrary-precision decimal arithmetic
- Host: GitHub
- URL: https://github.com/josecelano/php-complex
- Owner: josecelano
- Created: 2020-02-29T10:02:49.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-17T17:24:10.000Z (about 5 years ago)
- Last Synced: 2025-04-01T21:54:38.106Z (2 months ago)
- Topics: arbitrary-precision, complex, php
- Language: PHP
- Size: 36.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PHP Complex
I'm working on a PHP Fractal kata:
[PHP Mandelbrot Kata](https://github.com/josecelano/php-mandelbrot-arbitrary-precision)
In order to get be able to zoom in the final Mandelbrot Set image as much as I want I need arbitrary precision for some complex number operations. In this package I'have implemented only the operations needed.
This is the arbitrary precision package being used:
[php-decimal.io](https://php-decimal.io/)
## Prerequisites
* PHP 7.4
## Installation
```
docker build -t php-complex .
docker run -it --rm \
-v "$PWD":/usr/src/app \
-w /usr/src/app \
-u $(id -u ${USER}):$(id -g ${USER}) \
php-complex \
composer install
```## Running the tests
```
docker run -it --rm \
-v "$PWD":/usr/src/app \
-w /usr/src/app \
-u $(id -u ${USER}):$(id -g ${USER}) \
php-complex
```## Acknowledgments
* https://github.com/MarkBaker/PHPComplex
## TODO
* Allow to define precision for each complex instance