This code works (C# 3)
double d; if(d == (double)(int)d) ...;
This would work I think:
if (d % 1 == 0) { //... }