Now uses floorf instead of double casting