When dividing by ints and I want the result to be a float I can end up with something like this.
float ratio = landscape ?
((float) image.getWidth()) / ((float)image.getHeight()) :
((float)image.getHeight()) / ((float)image.getWidth());
However I think I don't need every cast. When diving sometimes it seems to be auto casted. What are the rules, when does this happen?