Anonymous user
Pythagorean triples/Java/Brute force primitives: Difference between revisions
Pythagorean triples/Java/Brute force primitives (view source)
Revision as of 19:45, 16 November 2011
, 12 years agoPossibly 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);
|