Newbie Question... modulo

Hi there!

Hm, shame on me but I really don't get it.

I just want to do sth. like that:

int i = someInt;

if ((i %=2) == 0) {

dosth();

}

How do I manage comparing an int value with an Float value reduced to the "int-part"?

Thanks in advance

Bumbes

[314 byte] By [bumbes] at [2007-9-26 9:28:32]
# 1
Maybe also shame on me, but I don't see a float value in your code. However, to compare an int with an int part of an float could be resolved with casting. Like that:int i;float f;...if (i == (int) f) {...}Robert
tailorman at 2007-7-1 20:51:23 > top of Java-index,Java HotSpot Virtual Machine,Specifications...