Skip to content

Commit

Permalink
Merge pull request #7 from DesWurstes/patch-1
Browse files Browse the repository at this point in the history
Fix wrong result due to overflowing
  • Loading branch information
andreacorbellini authored Oct 11, 2020
2 parents 26d4247 + 344a56c commit 865b8f9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions interactive/ec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,8 @@
}
}

m %= this.k;

var x3 = ( m * m - x1 - x2 ) % this.k;
var y3 = ( m * ( x1 - x3 ) - y1 ) % this.k;

Expand Down

0 comments on commit 865b8f9

Please sign in to comment.