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; } }
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; } }
public BigNumber(BigInteger val) { integerVal = new BigInt(val); Type = NumberType2.integer; }