Check the commutativity of gcd.