cm0002@lemmy.world to Programmer Humor@programming.dev · 2 个月前Which of these javascript expressions is false?lemmy.mlimagemessage-square83linkfedilinkarrow-up1513arrow-down111cross-posted to: [email protected]
arrow-up1502arrow-down1imageWhich of these javascript expressions is false?lemmy.mlcm0002@lemmy.world to Programmer Humor@programming.dev · 2 个月前message-square83linkfedilinkcross-posted to: [email protected]
minus-squaresorter_plainview@lemmy.todaylinkfedilinkarrow-up61·2 个月前 Spoiler What is the rationale for all comparisons returning false for IEEE754 NaN values?
minus-squareskisnow@lemmy.calinkfedilinkEnglisharrow-up24·2 个月前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.
minus-squareVictor@lemmy.worldlinkfedilinkarrow-up5·2 个月前It 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.