title: Swift zero divided by zero gives NAN
body: <p>I am doing some calculation using Swift. I understand that in Swift, 0/0 gives NAN (not a number) instead of 0. Is there anyway for it to return 0 instead?</p>
  
  <pre><code>for x in 0..&lt;n {
  for y in 0..&lt;n {
  if(B[0,y,x]==NAN) {B[0,y,x]=0 }    //use of undeclared identifier 'NAN'
  
  println("\((Float)B[0,y,x])")
  
  }
  }
  </code></pre>