Simple Question about Numeric Operations I have a question that may be easily answered, but the answer evades me.  In regards to numeric operations, how come when I code this:

double celsius = 30;
double fahrenheit = (celsius + 32.0) / (5/9);


I get an answer:

fahrenheit = infinity;


But, when I code this:

double fahrenheit = (celsius + 32.0) / (5.0/9);  // with a decimal place after 5 or 9


The answer comes out correctly as 111.6?

Shouldn't the (5/9) automatically become a double without the decimal, or am I incorrect?
Division by zero gets you infinity.

Note that (5/9) is an int expression, and resolves to int 0!

To fix things, make your literals doubles : 

double celsius = 30d;
double fahrenheit = (celsius + 32.0d) / (5d/9d);