The ceil and floor methods will help you determine if the number is a whole number.
However if you want to determine if the number can be represented by an int value.
if(value == (int) value)
or a long (64-bit integer)
if(value == (long) value)
or can be safely represented by a float without a loss of precision
if(value == (float) value)
BTW: don't use a 32-bit float unless you have to. In 99% of cases a 64-bit double is a better choice.