bignumeric
v1.0.0
Published
Handles the basic mathematics operation between 2 numbers. It also support multiple numeral system like base 8, 10, 16 and 36
Downloads
9
Readme
Big numbers
This library handles the basic mathematics operation between 2 numbers. These numbers can be of large digits like 100 digits or can be 1 or 2 digit number. Number can be also be alpha numeric like base 16 or base 36 numbers. It also supports conversion from one numeral system to another.
Installation
NPM
npm i bignumeric
PNPM
pnpm i bignumeric
YARN
yarn add bignumeric
Quick Start
Import
import { Bignum, NumeralSystem } from 'bignumeric';
Usage
const num1 = Bignum.parse('234.67', NumeralSystem.Base10);
const num2 = Bignum.parse('42.077', NumeralSystem.Base10);
const sum = num1.add(num2);
console.log(sum.toString()); // 276.747
Note Check Bignum.md and NumeralSystem.md for more details
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Add your changes:
git add .
- Commit your changes:
git commit -m 'your commit message'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request 😎
Development
Local Development
pnpm install
pnpm build
Test
pnpm test