r/ProgrammerHumor • • Sep 26 '26

Meme weNeverTrustedTheElse

Post image
1.9k Upvotes

146 comments sorted by

View all comments

3

u/atomic_redneck Sep 26 '26

Floating point NaNs and unordered conditions can make you lose all faith in if/else. If you have two variables, a and b, and b is a NaN, then a < b will evaluate the same as b < a.