title: How do I check whether a vector is equal to another vector that contains NaN and inf?
body: <p>I have a test of division, where I sometimes need to check that my results are either <code>NaN</code> or <code>inf</code>, but it seems like Rust does not consider NaN to be equal to NaN:</p>
  
  <pre><code>fn main() {
      let nan = "NaN".parse::&lt;f64&gt;().unwrap();
      println!("{:?}", nan);
      println!("{:?}", nan == nan);
  } // NaN false
  </code></pre>
  
  <p>How do I compare two vectors that contain NaN and infinity to see whether they are equal?</p>