git.delta.rocks / unique-network / refs/commits / f4f52b6653f2

difftreelog

fix sumx => sumx2

Yaroslav Bolyukin2022-12-19parent: #1a01477.patch.diff
in: master

1 file changed

modifiedtests/src/calibrate.tsdiffbeforeafterboth
126126
127 const nb = new Fract(BigInt(n));127 const nb = new Fract(BigInt(n));
128
129 // This is a workaround to beat the lack of precision of the `Number` type.
130 // We divide `BigInt`s. But since it is an integer division, we should take care of the precision on our own.
131 // After the division we can convert the result back to the `Number` and then we set the correct precision.
132 // It is crucial to have the correct slope for the regression line.
133128
134 const a = rpn(129 const a = rpn(
135 [nb, sumxy, '*', sumx, sumy, '*', '-'],130 [nb, sumxy, '*', sumx, sumy, '*', '-'],
136 [nb, sumx, '*', sumx, sumx, '*', '-'],131 [nb, sumx2, '*', sumx, sumx, '*', '-'],
137 '/',132 '/',
138 );133 );
139 const b = rpn(134 const b = rpn(