robertbakker / big-calculator
Calculator with big numbers
Installs: 55
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/robertbakker/big-calculator
Requires
- php: ^7.1
- brick/math: 0.7.* | 0.8.*
Requires (Dev)
- codedungeon/phpunit-result-printer: ^0.23.4
- larapack/dd: 1.*
- phpbench/phpbench: @dev
- phpunit/phpunit: ^7.3
- spatie/phpunit-watcher: ^1.6
This package is auto-updated.
Last update: 2022-08-18 18:42:49 UTC
README
Just a simple calculator using big numbers with arbitrary precision.
Uses brick/math for the big numbers.
Disclaimer: As with any calculations done by a computer, always check them. Especially
when dealing with calculations using decimals.
Usage
use RobertBakker\BigCalculator\Calculator; $calculator = Calculator::create(); $calculator->calculate("1.234 / 5 + 3.4"); // outputs \Brick\Math\BigDecimal
Variables
// Example with 4% interest over 3 years $calculator = Calculator::create(); $calculator->addVariable("years", 3); $calculator->calculate("2000 * 1.04 ^ years");
Development
# For testing purposes
composer run test
# Benchmarking
composer run bench