why cast to a float before casting to an int