Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function ediv_rem$prime$2(_a, _b, _cum) {
while(true) {
var cum = _cum;
var b = _b;
var a = _a;
var a$1 = Int64.abs(a);
var b$1 = Int64.abs(b);
var r = Caml_int64.sub(a$1, b$1);
if (Caml_int64.compare(a$1, b$1) === 1) {
_cum = Caml_int64.add(cum, Int64.one);
_b = b$1;
_a = r;
continue ;
} else {
return /* tuple */[
Caml_int64.add(cum, Int64.one),
r
];
}
};
}
function pred$2(x) {
return Caml_int64.sub(x, Int64.one);
}
function mod$1(a, n) {
return Caml_int64.sub(a, Caml_int64.mul(n, Caml_int64.div(a, n)));
}