Why: float c = a / (float) b; and not: float c = (float) a / b; The result is the same, but it's not correct (7th condition).