Will a double equal to an integer always cast to that integer (assuming the double is not one that causes an overflow). Example: [Math.ceil()](http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#ceil%28double%29) will return a double that is equal to an integer. Assuming no overflow, will it always cast to the same integer that it is supposedly equal to? 

If not, how can I round up a `double` to an `int` or `long`?