How do you check if the number you got is an int or a double?

I have done some researching, and found out that you can use Math.floor(double a), and Math.ceil(...).

But these methods aren't useful in my situation, or maybe I just don't use them right.

Let's say that I make this computation:

int result = 42/4 //now clearly this result is a double value, so the program should not take it into account. It should only be taken into account if the result is an int. Howw would you do that?

So, something like:

Forgot the while true and other mistakes, I'll fix those, only help needed is for the problem I'm asking

public int tryDevide(int number){ int res = 0; while(true){ for(int i = 3000; i > 1; i--){ for(int j = 1; j < 10; j++){ if(number / j == an int){ res = number; } else{ number is a double, and is useless;

This post has been edited by **IamTw_**: 27 March 2011 - 04:41 PM