Throw error if (n == 0)