Skip to content

Commit

Permalink
#10 - maxPath not maxValue for path rec
Browse files Browse the repository at this point in the history
  • Loading branch information
obriensystems committed Jan 2, 2025
1 parent cb340f2 commit 71267a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public boolean isCollatzMax(long oddSearchCurrent, long secondsStart) {
//result = Long.valueOf(current);
}
if (path > globalMaxPath.get()) {
globalMaxPath.set(maxValue);
globalMaxPath.set(path);
System.out.println("mp: " + oddSearchCurrent + " p: " + path + " m: " + (maxValue << 1) + " ms: "
+ (System.currentTimeMillis() - secondsLast) + " dur: " + ((System.currentTimeMillis() - secondsStart) / 1000));
secondsLast = System.currentTimeMillis();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ public boolean isCollatzMax(BigInteger oddSearchCurrent, long secondsStart) {
if (current.compareTo(TWO) < 0) {
// check limits
if (maxValue.compareTo(globalMaxValue) > 0) {
globalMaxValue = maxValue; // double this n(3/2)
globalMaxValue = maxValue.shiftLeft(1); // double this n(3/2)
System.out.println("m0: " + oddSearchCurrent + " p: " + path + " m: " + maxValue.shiftLeft(1) + " ms: "
+ (System.currentTimeMillis() - secondsLast) + " dur: " + ((System.currentTimeMillis() - secondsStart) / 1000));
secondsLast = System.currentTimeMillis();
result = true;
//result = Long.valueOf(current);
}
if (path.compareTo(globalMaxPath) > 0) {
globalMaxPath = maxValue; // double this n(3/2)
globalMaxPath = path;
System.out.println("mp: " + oddSearchCurrent + " p: " + path + " m: " + maxValue.shiftLeft(1) + " ms: "
+ (System.currentTimeMillis() - secondsLast) + " dur: " + ((System.currentTimeMillis() - secondsStart) / 1000));
secondsLast = System.currentTimeMillis();
Expand Down

0 comments on commit 71267a2

Please sign in to comment.