0

5e+22 + 1e+23 is giving 1.4999999999999e23 How can I fix this behavior?

I have tried using Number.EPSILON but either I am using it improperly or it does not solve this problem

  • Your inputs have precision of 1. Your output is correct, assuming you use precision to display it. `console.log((5e+22 + 1e+23).toPrecision(2))` – James Apr 04 '23 at 19:41

0 Answers0