One of the issues that we face when working with big numbers is mathematical operations. Specially in Javascript, it gives us the wrong result for any math operations on a number bigger than 9007199254740991.
This file will make us to do all the main mathematics operation by making the numbers into strings and works with strings.
There is a class named MathOperation
which can be used to do the operations.
-
To get a number and make each digit in a slot.
-
To get the sum of all digits.
-
To check if a number is a factor of number 2.
-
To check if a number is a factor of number 3.
-
To check if a number is a factor of number 6.
-
To get the maximum between two numbers.
-
To get the minimum between two numbers.
-
To add two numbers.
-
To subtract two numbers.
-
To multiply two numbers.
-
To multiply two numbers. / this is another way.
-
To divide two numbers./ The result will be an array. The first element is the Math.floor of that division and the second elemenet is the residual of that.
-
To Find the Math.floor(Math.sqrt) of a number.
-
To power a number by another number.
-
To Find the residual of a division between two numbers.