Posted on 2008-10-28
Hopefully an easy one.
I'm parsing two strings and converting them to doubles using double.Parse .
string1 = 2.32;
string2 = 2.37.
So i use if( double.Parse(string2) > double.Parse(string1)
The problem occurs, very rarely, that it will still go into "do something" even if string2 is not greater than string1. My values usually aren't so close....by that i mean that string1 and string2 values could be a lot further apart. So i'm wondering if there is any way that the double.Parse is rounding anything off, so when the values are too close like in the example above the statement holds true.