valueOf() private method

private valueOf ( long val ) : BigInt
val long
return BigInt
コード例 #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())));
 }
コード例 #2
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())));
 }
コード例 #3
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())));
 }
コード例 #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())));
 }
コード例 #5
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())));
 }