Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: