float.NaN in C#
I have an instance variable of type float that I set to float.NaN if the relevant column in the database is null. When I iterate through an arraylist containing these objects, I want to check the float value.
eg.
for (int j=0; j<arraylist.Count; j++)
{
Order order = (Order) arraylist[j];
if (order.amount != float.NaN)
{
Console.Writeline(amount.ToString());
}
else
{
Console.Writeline();
}
}
But this seems to ignore the else part and it displays NaN when the amount is NaN.
How would I use the float.NaN?
Thanks.
Kobus

