It would be nice if the math used was high precision. I have run into issues with this.
You may want to use big.js