mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
improvements
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user