Sorry, this might be a easy stupid question, but I need to know to be sure.
I have this if
expression,
void Foo()
{
System.Double something = GetSomething();
if (something == 0) //Comparison of floating point numbers with equality
// operator. Possible loss of precision while rounding value
{}
}
Is that expression equal with
void Foo()
{
System.Double something = GetSomething();
if (something < 1)
{}
}
? Because then I might have a problem, entering the if
with e.g. a value of 0.9.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…