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); }
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); }