Pythagorean triples/Java/Brute force primitives: Difference between revisions

m
Possibly saving one addition every once in a while
(When I said "very very slight speedup" I was only looking at the perimeter < 1000 results. It actually makes a huge difference.)
m (Possibly saving one addition every once in a while)
Line 87:
(aabb.and(B127).intValue() != 16) &&
(aabb.and(B191).intValue() != 0)) continue;
BigInteger ab = a.add(b);
if(a.multiply(b).mod(B12).compareTo(ZERO) != 0) continue;
BigInteger ab = a.add(b);
 
for(BigInteger c = b.add(b.and(ONE).equals(ONE)? TWO:ONE);
Anonymous user