System.Double.NaN Field

**Value: **NaN

public const double **NaN**

A method or operator returns double.NaN when the result of an operation is undefined. For example, the result of dividing zero by zero is double.NaN, as the following example shows. (But note that dividing a non-zero number by zero returns either double.PositiveInfinity or double.NegativeInfinity, depending on the sign of the divisor.)

code reference: System.Double.NaN#1

In addition, a method call with a double.NaN value or an operation on a double.NaN value returns double.NaN, as the following example shows.

code reference: System.Double.NaN#2

Use the double.IsNaN(double) method to determine whether a value is not a number. Two double.NaN values are considered unequal to one another. Therefore, it is not possible to determine whether a value is not a number by using the equality operator to compare it to another value that is equal to NaN. The comparison returns false, as the following example shows.

code reference: System.Double.NaN#3