예제 #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;
     }
 }
예제 #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;
     }
 }
예제 #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;
     }
 }
예제 #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;
            }
        }
예제 #5
0
 public BigNumber(BigRational val)
 {
     Type        = NumberType2.rational;
     rationalVal = val;
 }
예제 #6
0
 public BigNumber(BigInteger val)
 {
     integerVal = new BigInt(val);
     Type       = NumberType2.integer;
 }
예제 #7
0
 public BigNumber(BigRational val)
 {
     Type = NumberType2.rational;
     rationalVal =  val;
 }
예제 #8
0
 public BigNumber(BigInteger val)
 {
     integerVal = new BigInt(val);
     Type = NumberType2.integer;
 }