reduce minimum diff

This commit is contained in:
Ben Wilson
2023-06-28 10:23:54 -04:00
parent e230e25e91
commit 37a65e43b2
2 changed files with 16 additions and 13 deletions
+6 -6
View File
@@ -63,18 +63,18 @@ export class StratumV1ClientStatistics {
}
private blpo2(x) {
x = x | (x >> 1);
private blpo2(val) {
let x = val | (val >> 1);
x = x | (x >> 2);
x = x | (x >> 4);
x = x | (x >> 8);
x = x | (x >> 16);
x = x | (x >> 32);
const val = x - (x >> 1);
if (val < 1) {
return 1;
const res = x - (x >> 1);
if (res < 1) {
return this.blpo2(val * 100) / 100;
}
return val;
return res;
}