We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8c32fab commit 574a2e7Copy full SHA for 574a2e7
src/ladder.ts
@@ -387,8 +387,11 @@ export class GlickoPlayer {
387
388
// Follow along the steps using: http://www.glicko.net/glicko/glicko.pdf
389
390
+ let RD = Math.sqrt((this.rd * this.rd) + (this.c * this.c));
391
+ if (RD > this.RDmax) {
392
+ RD = this.RDmax;
393
+ }
394
if (m.length === 0) {
- const RD = Math.sqrt((this.rd * this.rd) + (this.c * this.c));
395
return { R: this.rating, RD };
396
}
397
@@ -405,7 +408,7 @@ export class GlickoPlayer {
405
408
406
409
d2 = 1.0 / this.q / this.q / d2;
407
410
- let RD = 1.0 / Math.sqrt(1.0 / (this.rd * this.rd) + 1.0 / d2);
411
+ RD = 1.0 / Math.sqrt(1.0 / (RD * RD) + 1.0 / d2);
412
const R = this.rating + this.q * (RD * RD) * A;
413
414
if (RD > this.RDmax) {
0 commit comments