.NET's double.NaN - how does this counterintuitive feature work?
- by GeReV
I stumbled upon the definition of double.NaN in code:
public const double NaN = (double)0.0 / (double)0.0;
This is done similarly in PositiveInfinity and NegativeInfinity.
double.IsNaN (with removing a few #pragmas and comments) is defined as:
[Pure]
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
public static bool…