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

Why would you feel dirty? In this case it is solving for exact equality, ie the same bits, it doesn't matter that the value is a float.

Though I have seen some people using a double as a primary key (no idea why) and some database engine (internal, not major vendor) failing to do equality comparisons in certain statements, I suspect because they must be switching to "close enough" which is not what you expect when you write col1 = col2.



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

Search: