Utility function to compare the equality of two inputs.