kabbouchi/bignumber

A PHP package for arbitrary-precision decimal and non-decimal arithmetic inspired by bignumber.js

0.0.6 2022-06-12 20:12 UTC

This package is auto-updated.

Last update: 2024-12-13 02:36:01 UTC


README

A PHP package for arbitrary-precision decimal and non-decimal arithmetic inspired by bignumber.js

Installation

composer require kabbouchi/bignumber

Usage

use KABBOUCHI\BigNumber;

BigNumber::of(123)->plus(12)->div(1234)->toString();

BigNumber::of(1)
  	->div(5)
  	->times(BigNumber::of(10)->pow(9))
  	->div(1.453)
  	->negated()
  	->abs()
  	->toFixed(4);

License

The MIT License (MIT). Please see License File for more information.