Question: My method is as follows

```
  def myMethod(myDouble: Double): Double = myDouble match {
    case Double.NaN => ...
    case _ => ...
  }

```

The IntelliJ debugger is showing NaN but this is not being picked up in my pattern matching. Are there possible cases I am omitting

Answer: 
You can write an extractor (updated according to bse's comment):

```
object NaN {
  def unapply(d:Double) = d.isNaN
}

0.0/0.0 match {
  case NaN() => println("NaN")
  case x => println("boring " + x)
}
//--> NaN

```
Tomasz is correct. You should use `isNaN` instead.

```
scala> Double.NaN.isNaN
res0: Boolean = true

```