in C#, if you 0/0
you get an exception.
But if you 0.0/0
or 0.0/0.0
you get double.NaN
and
This is mainly due to the fact that double.NAN and double.PositiveInfity ( or double.Negative for the matter) are not numbers but rather values to identify a concept.
A method or operator returns NaN when the result of an operation is undefined. For example, the result of dividing zero by zero is NaN, as the following example shows.
try this to illustrate that concept.
if ((0 / zero) == Double.NaN)
Console.WriteLine("0 / 0 can be tested with Double.NaN.");
else
Console.WriteLine("0 / 0 cannot be tested with Double.NaN; use Double.IsNan() instead.");