Skip to content

Commit

Permalink
Fix the singularity warning in the "mod k" case
Browse files Browse the repository at this point in the history
  • Loading branch information
andreacorbellini committed Nov 18, 2023
1 parent 865b8f9 commit 03e62a0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions interactive/ec.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,6 @@
};

$.ec.Base.prototype.recalculate = function() {
this.singular =
( 4 * this.a * this.a * this.a + 27 * this.b * this.b ) === 0;
// Order is important.
this.roots = this.getRoots();
this.plotRange = this.getPlotRange();
Expand Down Expand Up @@ -731,6 +729,8 @@
};

$.ec.reals.Base.prototype.recalculate = function() {
this.singular =
( 4 * this.a * this.a * this.a + 27 * this.b * this.b ) === 0;
this.stationaryPoints = this.getStationaryPoints();
$.ec.Base.prototype.recalculate.call( this );
};
Expand Down Expand Up @@ -1441,6 +1441,8 @@
};

$.ec.modk.PointAddition.prototype.recalculate = function() {
this.singular =
( 4 * this.a * this.a * this.a + 27 * this.b * this.b ) % this.k === 0;
this.r = this.addPoints( this.p, this.q );
$.ec.modk.Base.prototype.recalculate.call( this );
};
Expand Down

0 comments on commit 03e62a0

Please sign in to comment.