public bool IsZero() { return sign == 0; }
// Like GetBitCount(Abs(x)), except 0 maps to 0 public static int BitLength(BigInteger x) { if (x.IsZero()) { return 0; } return x.Abs().GetBitCount(); }