コード例 #1
0
        public PoweredPrime[] Divide(UInt32 value, PoweredPrime[] denominatorFactors)
        {
            PoweredPrime[] resultingFactors;
            lock (sharedPrimeList)
            {
                PrimeFactorization.BruteFoce(value, sharedPrimeList);

                denominatorFactors.DivideInto(sharedPrimeList);
                resultingFactors = sharedPrimeList.ToArray();
                sharedPrimeList.Clear();
            }
            return(resultingFactors);
        }
コード例 #2
0
        public PoweredPrime[] PrimeFactorize(UInt32 value)
        {
            if (value < 2)
            {
                return(PoweredPrime.None);
            }

            PoweredPrime[] primeFactors;
            lock (sharedPrimeList)
            {
                PrimeFactorization.BruteFoce(value, sharedPrimeList);
                primeFactors = sharedPrimeList.ToArray();
                sharedPrimeList.Clear();
            }
            return(primeFactors);
        }