BigRational val = coefficient.value;
if(gcd == null) {
// Must use abs() here, otherwise can end up with negative gcd.
// This is problematic for inequalities as it necessitate
// changing their sign.
gcd = val.abs();
} else {
// Note, gcd of two numbers (either of which may be negative) is
// always positive.
gcd = gcd.gcd(val);
}