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 so
Here is the example presenting the problem (prepared in LinQPad - if you don't have it just use Console.Writeline instead of Dump method):
void Main()
{
double x = 0.000001 / 0.1;
double y = 0.001 * 0.01;
double res = (x-y);
res.Dump();
(res == 0).Dump();
}
Both x and y are theoretically same and equal to: 0.00001 but because of lack of "infinite precision" those values are slightly different. Unfortunately slightly enough to return false when comparing to 0 in usual way.