This code works (C# 3)
double d; if(d == (double)(int)d) ...;
Something like this
double d = 4.0; int i = 4; bool equal = d.CompareTo(i) == 0; // true