static BigInteger ToBigInteger(object x)
{
BigInteger bigInteger = x as BigInteger;
if (bigInteger != null)
return bigInteger;
BigInt bigInt = x as BigInt;
if ( bigInt != null )
return bigInt.toBigInteger();
return BigInteger.Create(Util.ConvertToLong(x));
}