Better HN
topnewbestaskshowjobs
Log inSign up

dr0nkprogrammer

-4 karma · joined May 26, 2020 (6y ago) · 1 submissions

Submissions

comment 6y ago · link · parent

Javascript:

console.log((0.1 + 0.2) === 0.3) // => false

C#:

(0.1m + 0.2m) == 0.3m // => true

see here: https://dotnetfiddle.net/zVnrNQ

Javascript is such a poor language, there is no even a good way to work with currencies or exact numbers and you have to multiply numbers with a factor to avoid such problems. The worst language I ever used.