public override int GetHashCode() { int hc = magnitude.Length; if (magnitude.Length > 0) { hc ^= magnitude[0]; if (magnitude.Length > 1) { hc ^= magnitude[magnitude.Length - 1]; } } return sign < 0 ? ~hc : hc; }