Example #1
0
 public BigNumber(double val)
 {
     if (val == Math.Floor(val)) {
         integerVal = new BigInt((int)val);
         Type = NumberType2.integer;
     } else {
         rationalVal = new BigRational(val);
         Type = NumberType2.rational;
     }
 }
Example #2
0
 public BigNumber(double val, NumberType2 type)
 {
     Type = type;
     switch (type) {
         case NumberType2.integer:
             integerVal = new BigInt((int)val);
             break;
         case NumberType2.rational:
             rationalVal = new BigRational(val);
             break;
         case NumberType2.irrational:
             irrationalVal = new BigIrrational(val);
             break;
     }
 }
Example #3
0
 public BigNumber(BigInteger val)
 {
     integerVal = new BigInt(val);
     Type       = NumberType2.integer;
 }
Example #4
0
 public BigNumber(BigInteger val)
 {
     integerVal = new BigInt(val);
     Type = NumberType2.integer;
 }