Sci-Calci is a library which allows to do operations on huge digits of integer numbers that cannot be handled by pure JavaScript.
The library is still under development and testing. Not suitable for Production system.
- Node version >=14.0.0
- Can be consumed as CommonJs or ES module
- The library is only supported in NodeJs.
- The package supports the operations only integer numbers.
npm install --save sci-calci
const assert = require('assert');
const {add, sub, mul, addFromArray, lt} = require('sci-calci');
assert.strictEqual(
add('95857458950595857575789506', '969685885748595050059484'),
'96827144836344452625848990',
'Addition failed',
);
assert.strictEqual(
sub('95857458950595857575789506', '969685885748595050059484'),
'94887773064847262525730022',
'Subtraction failed',
);
assert.strictEqual(
mul('958504957305857494505', '2049584045585058958'),
'1964536468108273617340322645756586025790',
'Multiplication failed',
);
assert.strictEqual(
addFromArray(['21', '95', '25']),
'141',
'Add numbers from array failed',
);
assert.strictEqual(lt('100', '153'), true, '100 is less than 153');
assert.strictEqual(lt('153', '100'), false, '153 is not less than 100');
- Addition
- Subraction
- Multiplication
- Less than opertor
This project is licensed under the MIT License - see the LICENSE.md file for details.