<分区>
我有一个变量来自:
double result = myList.Count / mySeptum;
我想做以下事情:
if( result == int ) {
//Do Something...
}
else{
//Do another thing...
}
我该怎么做?
我也试过这个,但是没用:
if ( result%10 == 0 ){
...
}
举个例子:
private void button2_Click(object sender, EventArgs e)
{
int r = 10;
int l = 2;
double d = r / l;
if (d % 10 == 0)
{
Console.WriteLine("INTEGER");
}
else
{
Console.WriteLine("DOUBLE");
}
}