Huge Numbers
A npm package to apply math
Features:
- Numbers size limit:
- unlimited
- Math operators:
- Sum (+)
- Multiply (×)
Usage:
HugeNum can be used in node.js
Install HugeNum using npm:
npm install huge-num
Then you can define a huge number using a string
import HugeNum from 'huge-num';
const NUMBER_1 = "12213345674890";
const NUMBER_2 = "564564574982348";
let n1 = HugeNum(NUMBER_1);
let n2 = HugeNum(NUMBER_2);
Then you can use the operators on a huge number
huge_number_1.sum(huge_number_2)
const summation = n1.sum(NUMBER_2);
console.log(NUMBER_1 + ' + ' + NUMBER_2 + '=', summation);
// result -> 12213345674890 + 564564574982348= 576777920657238
huge_number_1.multiply(huge_number_2)
const multiply = n1.multiply(NUMBER_2);
console.log(NUMBER_1 + ' *+* ' + NUMBER_2 + '=', multiply);
// result -> 12213345674890 * 564564574982348= 6895222310056771043896841720
Documentation:
Contributors
To contribute, just fork the project, make some changes, and submit a pull request.
License
This project is public domain. For more details, read about the Unlicense.
Developer:
- Emad Armoun
- www.EmadArmoun.com
- Emad.Armoun@gmail.com
- LinkedIn profile