Corrected rounding with double instead of float division cast