Add missing cast to float to prevent rounding issues.