Microsoft.Scripting.Math.BigInteger.Compare C# (CSharp) 메소드

Compare() 공개 정적인 메소드

public static Compare ( BigInteger x, BigInteger y ) : int
x BigInteger
y BigInteger
리턴 int
    public static int Compare(BigInteger x, BigInteger y) {
      if (object.ReferenceEquals(x, null)) {
        throw new ArgumentNullException("x");
      }
      if (object.ReferenceEquals(y, null)) {
        throw new ArgumentNullException("y");
      }
      if (x.sign == y.sign) {
        int xl = x.Length;
        int yl = y.Length;
        if (xl == yl) {
          for (int i = xl - 1; i >= 0; i--) {
            if (x.data[i] == y.data[i]) continue;
            return x.data[i] > y.data[i] ? x.sign : -x.sign;
          }
          return 0;
        } else {
          return xl > yl ? +x.sign : -x.sign;
        }
      } else {
        return x.sign > y.sign ? +1 : -1;
      }
    }