示例#1
0
        public void RootExact()
        {
            string AsString;
            bool   IsRootExact;

            using mpz_t a = new mpz_t("9785412309485720938412983404349");
            AsString      = a.ToString();
            Assert.AreEqual("9785412309485720938412983404349", AsString);

            IsRootExact = a.IsRootExact(3);

            Assert.IsFalse(IsRootExact);

            mpz_t b = a * a * a;

            AsString = b.ToString();
            Assert.AreEqual("936995247845762439229916837840025004943963737679442023171062337518037547173883302933966320549", AsString);

            IsRootExact = b.IsRootExact(3);

            Assert.IsTrue(IsRootExact);
        }