Q:

Why does multiplcation by 1/2 not give the same value as multiplication by .5?

Like the title says, I'm a bit confused to why multiplying by 1/2 is somehow different then multiplying by 0.5. 
Take the following code:
double range = (46/2) + (1/2 * height); //say height is 10 

this returns: 
23 

Which is clearly an incorrect value, it seems to be only evaluating the 46/2 part.
However, when I do this:
double range = (46/2) + (.5 * height); //say height is 10 

this returns: 
28

Which is correct. 
So why is this the case? 
(I'm sure this has been asked before at some point, however I'm not sure what to call this situation and a search in SO & google did not find me the answer) 

A:

1/2 * height is 0 because 1/2 is 0 due to integer semantics.
Try 1.0/2 * height and you will get the same result

