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

I see this advice often and I find that it misses the point. The problem isn't the equality check, the problem is finite precision.

There are situations that call for exact equality checking in floating point.



In which case, you don't use IEEE 754 floating point for math, you use some kind of numerics type or library that correctly models the domain.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: