Comparing expressions with bases and exponents