Simple-JavaScript-Calculator icon indicating copy to clipboard operation
Simple-JavaScript-Calculator copied to clipboard

JS Floating point number precision issue

Open ZigaoWang opened this issue 1 year ago • 3 comments

There is floating point number precision issue in this calculator which is a problem from the JS. For example: 0.1+0.2=0.30000000000000004 You can round it to 0.3 You can check out this page: https://stackoverflow.com/questions/1458633/how-can-i-deal-with-floating-point-number-precision-in-javascript Other than that, this calculator is absolutely cool! Thank you for your hard work!

ZigaoWang avatar May 03 '24 14:05 ZigaoWang

0.1 is the error

Nani-14 avatar May 08 '24 17:05 Nani-14

@Nani-14 What do you mean? Thx

ZigaoWang avatar May 09 '24 08:05 ZigaoWang

@harsh98trivedi Can you take a look? Thank you so much!

ZigaoWang avatar Jun 07 '24 13:06 ZigaoWang