I need to perform arithmetical operations with large numbers in JS, in this particular case it is:
(1827116622 / 6) * 251772294
The expected result is 76669557221078478 but I am getting 76669557221078460 because of integer overflow.
The environment does not allow including any libraries. Is there a workaround to handle calculations like this?
Why I am doing so: I am trying to find the least common multiplier for these numbers using the following formula:
LCM(, )·GCD(, ) = · where LCM is Least Common Multiplier and GCD is Greatest Common Divisor.
My calculation is ( a / gcd ) * b
.