예제 #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);
        }