Checking for NaN value of "double" type has been fixed.

A condition 
    doubleVal == Double.NaN 
will return FALSE every time.

There is an explanation at the Stackoverflow: http://stackoverflow.com/a/8819776