Skip to content

Commit

Permalink
#12 - adjust collatz long code
Browse files Browse the repository at this point in the history
  • Loading branch information
obriensystems authored Dec 29, 2024
1 parent e66d02c commit cb6c403
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public void computeRange1bruteForceLong(long aStart, long anEnd) {
+ " T: " + (System.currentTimeMillis() - lastMaxTime));
lastMaxTime = System.currentTimeMillis();
}
current = current + 1;
current = current + 2;
}
System.out.println("Total time: " + (System.currentTimeMillis() - totalStartTime));
}
Expand All @@ -300,7 +300,7 @@ public static void main(String[] args) {
//BigInteger aStart = BigInteger.valueOf(27);
//BigInteger aEnd = BigInteger.valueOf(27);
int aStart = 1;
int aEnd = 28;
int aEnd = 32;
BigInteger maxPath = BigInteger.valueOf(1);
BigInteger maxValue = BigInteger.valueOf(1);

Expand Down Expand Up @@ -334,8 +334,10 @@ public static void main(String[] args) {
//collatz.compute();

//collatz.computeRange();//aStart, aEnd);
long maxEnd = (1 << 31) - 1;
System.out.println(maxEnd);
collatz.computeRange1bruteForceLong(1, maxEnd);
//collatz.computeRange1bruteForce();
collatz.computeRange1bruteForceLong(1, 2 << aEnd );

}

Expand Down

0 comments on commit cb6c403

Please sign in to comment.