toBigInteger() private method

private toBigInteger ( ) : BigInteger
return BigInteger
Example #1
0
 public BigInt remainder(BigInt y)
 {
     if ((_bipart == null) && (y._bipart == null))
     {
         return(BigInt.valueOf(_lpart % y._lpart));
     }
     return(BigInt.fromBigInteger(this.toBigInteger().Mod(y.toBigInteger())));
 }
Example #2
0
 public bool lt(BigInt y)
 {
     if ((_bipart == null) && (y._bipart == null))
     {
         return(_lpart < y._lpart);
     }
     return(this.toBigInteger().CompareTo(y.toBigInteger()) < 0);
 }
Example #3
0
 public BigInt quotient(BigInt y)
 {
     if ((_bipart == null) && (y._bipart == null))
     {
         return(BigInt.valueOf(_lpart / y._lpart));
     }
     return(BigInt.fromBigInteger(this.toBigInteger().Divide(y.toBigInteger())));
 }
Example #4
0
 public BigInt multiply(BigInt y)
 {
     if ((_bipart == null) && (y._bipart == null))
     {
         long ret = _lpart * y._lpart;
         if (y._lpart == 0 || ret / y._lpart == _lpart)
         {
             return(BigInt.valueOf(ret));
         }
     }
     return(BigInt.fromBigInteger(this.toBigInteger().Multiply(y.toBigInteger())));
 }
Example #5
0
 public BigInt add(BigInt y)
 {
     if ((_bipart == null) && (y._bipart == null))
     {
         long ret = _lpart + y._lpart;
         if ((ret ^ _lpart) >= 0 || (ret ^ y._lpart) >= 0)
         {
             return(BigInt.valueOf(ret));
         }
     }
     return(BigInt.fromBigInteger(this.toBigInteger().Add(y.toBigInteger())));
 }
Example #6
0
 public BigInt multiply(BigInt y)
 {
     if ((_bipart == null) && (y._bipart == null))
     {
         long ret = _lpart * y._lpart;
         if (y._lpart == 0 ||
             (_lpart != Int64.MinValue && unchecked (ret / y._lpart) == _lpart))
         {
             return(BigInt.valueOf(ret));
         }
     }
     return(BigInt.fromBigInteger(this.toBigInteger().Multiply(y.toBigInteger())));
 }
Example #7
0
 public BigInt remainder(BigInt y)
 {
     if ((_bipart == null) && (y._bipart == null))
     {
         return BigInt.valueOf(_lpart % y._lpart);
     }
     return BigInt.fromBigInteger(this.toBigInteger().Mod(y.toBigInteger()));
 }
Example #8
0
 public BigInt quotient(BigInt y)
 {
     if ((_bipart == null) && (y._bipart == null))
     {
         return BigInt.valueOf(_lpart / y._lpart);
     }
     return BigInt.fromBigInteger(this.toBigInteger().Divide(y.toBigInteger()));
 }
Example #9
0
 public BigInt multiply(BigInt y)
 {
     if ((_bipart == null) && (y._bipart == null))
     {
         long ret = _lpart * y._lpart;
         if (y._lpart == 0
             || (_lpart != Int64.MinValue && unchecked(ret / y._lpart) == _lpart ))
             return BigInt.valueOf(ret);
     }
     return BigInt.fromBigInteger(this.toBigInteger().Multiply(y.toBigInteger()));
 }
Example #10
0
 public bool lt(BigInt y)
 {
     if ((_bipart == null) && (y._bipart == null))
     {
         return _lpart < y._lpart;
     }
     return this.toBigInteger().CompareTo(y.toBigInteger()) < 0;
 }
Example #11
0
 public BigInt add(BigInt y)
 {
     if ((_bipart == null) && (y._bipart == null))
     {
         long ret = _lpart + y._lpart;
         if ((ret ^ _lpart) >= 0 || (ret ^ y._lpart) >= 0)
             return BigInt.valueOf(ret);
     }
     return BigInt.fromBigInteger(this.toBigInteger().Add(y.toBigInteger()));
 }
Example #12
0
 public BigInt multiply(BigInt y)
 {
     if ((_bipart == null) && (y._bipart == null))
     {
         long ret = _lpart * y._lpart;
         if (y._lpart == 0 || ret / y._lpart == _lpart)
             return BigInt.valueOf(ret);
     }
     return BigInt.fromBigInteger(this.toBigInteger().Multiply(y.toBigInteger()));
 }
Example #13
0
 public BigInt quotient(BigInt y)
 {
     if ((_bipart == null) && (y._bipart == null))
     {
         if (_lpart == Int64.MinValue && y._lpart == -1)
             return BigInt.fromBigInteger(this.toBigInteger().Negate());
         return BigInt.valueOf(_lpart / y._lpart);
     }
     return BigInt.fromBigInteger(this.toBigInteger().Divide(y.toBigInteger()));
 }