Expression evaluating to -1.#IND ?

I am performing following calc, where result if declared as double

result = (a - b) / b

Now

(1-0)/0 results in 1.#INF, which i can check using Double.IsInfinity method,

but (0-0)/0 results in -1.#IND, what does IND means, how can i check for expr evaluating to -1.#IND there is no Double.IsIND method.

Please help. Thanks

[390 byte] By [JobLot] at [2007-12-16]
# 1
Hi,
Use the double.IsNaN() function, IsNaN stands for Is Not a Number...

double a = 1, b = 0, c = 0;
double result = (a - b) / c;
if (double.IsNaN(result)) {
Console.WriteLine("Is Not a Number");
} else {
Console.WriteLine("Valid Number");
}


cheers,
Paul June A. Domag

PaulDomag at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2
thanks
JobLot at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...