• shilangyu (lemmur)
    link
    fedilink
    arrow-up
    13
    ·
    edit-2
    4 years ago

    I’m so bored of people bringing up NaN !== NaN when talking about “javascript’s wonkiness”. This is defined by IEEE for the floating point standard and it appears in any other language using IEEE 754 (which is the majority)

    • handvat
      link
      fedilink
      arrow-up
      5
      ·
      4 years ago

      You shouldn’t attempt comparing 2 floating point numbers with simply == (or === in JavaScript) in most cases and in most languages anyways.

    • spytfyre
      link
      fedilink
      arrow-up
      1
      ·
      4 years ago

      Totally agree. Moreover I can not think of a valid scenario where you would use such a comparison