src/share/classes/java/math/BitSieve.java
Print this page
*** 108,124 ****
int step = smallSieve.sieveSearch(smallSieve.length, start);
int convertedStep = (step *2) + 1;
// Construct the large sieve at an even offset specified by base
! MutableBigInteger r = new MutableBigInteger();
MutableBigInteger q = new MutableBigInteger();
do {
// Calculate base mod convertedStep
! r.copyValue(base.mag);
! r.divideOneWord(convertedStep, q);
! start = r.value[r.offset];
// Take each multiple of step out of sieve
start = convertedStep - start;
if (start%2 == 0)
start += convertedStep;
--- 108,122 ----
int step = smallSieve.sieveSearch(smallSieve.length, start);
int convertedStep = (step *2) + 1;
// Construct the large sieve at an even offset specified by base
! MutableBigInteger b = new MutableBigInteger(base);
MutableBigInteger q = new MutableBigInteger();
do {
// Calculate base mod convertedStep
! start = b.divideOneWord(convertedStep, q);
// Take each multiple of step out of sieve
start = convertedStep - start;
if (start%2 == 0)
start += convertedStep;