Skip to content

Commit 61bf8f6

Browse files
committed
comments
1 parent 5852d80 commit 61bf8f6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/main/java/de/tilman_neumann/jml/Divisors.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,15 +523,17 @@ public static BigInteger getBiggestDivisorBelowSqrtN(BigInteger n, SortedMap<Big
523523
public static BigInteger computeEulerPhi(BigInteger n) {
524524
if (n.equals(I_0)) return I_0;
525525

526+
// XXX do prime test before factorization?
527+
526528
SortedMap<BigInteger, Integer> factors = FactorAlgorithm.getDefault().factor(n);
527529
BigInteger num = I_1;
528530
BigInteger den = I_1;
529531
for (Map.Entry<BigInteger, Integer> entry : factors.entrySet()) {
530532
BigInteger divisor = entry.getKey();
531533
num = num.multiply(divisor.subtract(I_1));
532534
den = den.multiply(divisor);
535+
// XXX reduce num and den after a couple of multiplications by gcd?
533536
}
534537
return n.multiply(num).divide(den);
535538
}
536-
537539
}

0 commit comments

Comments
 (0)