For any integers x and y where x and y are not both 0, g=gcd(x,y) iff
1) g | x
2) g | y
3) for all integers z: z | x and z | y implies g | z.
Notice that by this general definition the gcd is unique up to multiplication by units (1 or -1) but by convention we take the positive value.