Exemplo n.º 1
0
        public void ToBigIntegerLarge()
        {
            BigInteger val   = BigInteger.Pow(2, 1024) + 3;
            var        pyInt = new PyInt(val);

            Assert.AreEqual(val, pyInt.ToBigInteger());
            val   = -val;
            pyInt = new PyInt(val);
            Assert.AreEqual(val, pyInt.ToBigInteger());
        }
Exemplo n.º 2
0
        public void ToBigInteger()
        {
            int[] simpleValues =
            {
                0,      1, 2,
                0x10,
                0x123,
                0x1234,
            };
            simpleValues = simpleValues.Concat(simpleValues.Select(v => - v)).ToArray();

            foreach (var val in simpleValues)
            {
                var pyInt = new PyInt(val);
                Assert.AreEqual((BigInteger)val, pyInt.ToBigInteger());
            }
        }