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)
 {
     if (val == Math.Floor(val))
     {
         integerVal = new BigInt((int)val);
         Type       = NumberType2.integer;
     }
     else
     {
         rationalVal = new BigRational(val);
         Type        = NumberType2.rational;
     }
 }
Example #3
0
 public BigNumber(float 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 #4
0
        public BigNumber(Decimal 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((double)val);
                break;
            }
        }
Example #5
0
 public BigNumber(BigRational val)
 {
     Type        = NumberType2.rational;
     rationalVal = val;
 }
Example #6
0
 public BigNumber(BigInteger val)
 {
     integerVal = new BigInt(val);
     Type       = NumberType2.integer;
 }
Example #7
0
 public BigNumber(BigRational val)
 {
     Type = NumberType2.rational;
     rationalVal =  val;
 }
Example #8
0
 public BigNumber(BigInteger val)
 {
     integerVal = new BigInt(val);
     Type = NumberType2.integer;
 }