Anonymous user
Pythagorean triples: Difference between revisions
→{{header|Java}}
m (→{{header|Java}}: Oops I copied in the 10K limit) |
|||
Line 223:
//change this to whatever perimeter limit you want;the RAM's the limit
BigInteger periLimit =
peri2 = periLimit.divide(
peri3 = periLimit.divide(
for(BigInteger a = ONE; a.compareTo(peri3) < 0; a = a.add(ONE)){
BigInteger aa = a.multiply(a);
for(BigInteger b =
b.compareTo(peri2) < 0; b = b.add(ONE)){
BigInteger bb = b.multiply(b);
Line 236:
BigInteger aabb = aa.add(bb);
for(BigInteger c =
c.compareTo(peri2) < 0; c = c.add(ONE)){
Line 252:
//does binary GCD under the hood
if(a.gcd(b).
System.out.print(" primitive");
primCount++;
|