コード例 #1
0
        public void Factor_120()
        {
            PrimeEngine e = new PrimeEngine(int.MaxValue);

            IEnumerable<int> factors = e.GetPrimeFactors(120);

            string joined = String.Join(",", factors.Select(x => x.ToString()).ToArray());
            Assert.IsTrue(joined.Equals("2,2,2,3,5"));
        }
コード例 #2
0
        public void Factor_TooLarge()
        {
            PrimeEngine e = new PrimeEngine(1000);

            IEnumerable<int> factors = e.GetPrimeFactors(5000);
        }