Skip to content

Commit

Permalink
Fix ml_z_rootrem
Browse files Browse the repository at this point in the history
Zero is represented as the OCaml integer 0.

Signed-off-by: Jérôme Vouillon <[email protected]>
  • Loading branch information
vouillon committed Nov 30, 2023
1 parent adee289 commit 6ae094f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ function ml_z_rootrem(z, i) {
}

if (z.equals(zero) || z.equals(one)) {
return [0, ml_z_normalize(z), zero];
return [0, ml_z_normalize(z), 0];
}

var start = zero;
Expand All @@ -628,7 +628,7 @@ function ml_z_rootrem(z, i) {
var mid = start.add(end).divide(two);
var po = mid.pow(i);
if (po.equals(z)) {
return [0, ml_z_normalize(mid), zero];
return [0, ml_z_normalize(mid), 0];
} else if (po.lt(z)) {
start = mid.next();
ans = mid;
Expand Down

0 comments on commit 6ae094f

Please sign in to comment.