cm0002@lemmy.world to Programmer Humor@programming.dev · 1 month agoWhich of these javascript expressions is false?lemmy.mlimagemessage-square75fedilinkarrow-up1489arrow-down110cross-posted to: programmerhumor@lemmy.ml
arrow-up1479arrow-down1imageWhich of these javascript expressions is false?lemmy.mlcm0002@lemmy.world to Programmer Humor@programming.dev · 1 month agomessage-square75fedilinkcross-posted to: programmerhumor@lemmy.ml
minus-squaresorter_plainview@lemmy.todaylinkfedilinkarrow-up61·1 month ago Spoiler What is the rationale for all comparisons returning false for IEEE754 NaN values?
minus-squareskisnow@lemmy.calinkfedilinkEnglisharrow-up24·1 month agoThat one wasn’t the one I had issues with, since the concept is essentially the same across all languages. We say it’s false because we can’t conclusively say that it’s true. Same as the reason why null != null in SQL.
minus-squareVictor@lemmy.worldlinkfedilinkarrow-up5·1 month agoIt also makes a lot of conditional expressions less complicated because comparisons of all kind against NaN return false.
Spoiler
What is the rationale for all comparisons returning false for IEEE754 NaN values?
That one wasn’t the one I had issues with, since the concept is essentially the same across all languages. We say it’s false because we can’t conclusively say that it’s true. Same as the reason why null != null in SQL.
It also makes a lot of conditional expressions less complicated because comparisons of all kind against NaN return false.