How to get precise integer result for multiplication and division operations of huge numbers in JS?
Let's say we have:
var a = 75643564363473453456342378564387956906736546456235342;
var b = 34986098309687982743378379458582778387652482;
Multiplying these numbers gives me a number in scientific "e" notation. How to display the whole precise integer result number?
I've tried using this library https://github.com/peterolson/BigInteger.js
Readme says:
Note that Javascript numbers larger than 9007199254740992 and smaller than -9007199254740992 are not precisely represented numbers and will not produce exact results. If you are dealing with numbers outside that range, it is better to pass in strings.
But how do you do math with strings?