compare 2 values of the same type in the type