improvements

This commit is contained in:
Ben Wilson
2023-06-29 11:59:17 -04:00
parent 8878b31377
commit cef9114c83
4 changed files with 32 additions and 20 deletions
+10 -2
View File
@@ -72,8 +72,16 @@ export class StratumV1ClientStatistics {
x = x | (x >> 32);
const res = x - (x >> 1);
if (res < 1) {
return 1;
//return this.blpo2(val * 100) / 100;
if (val < 0.01) {
return 0.01;
}
let y = (val * 100) | ((val * 100) >> 1);
y = y | (y >> 2);
y = y | (y >> 4);
y = y | (y >> 8);
y = y | (y >> 16);
y = y | (y >> 32);
return (y - (y >> 1)) / 100;
}
return res;
}