static const cl_I std_retract (cl_heap_modint_ring* R, const _cl_MI& x)
{
- unused R;
+ cl_unused R;
return x.rep;
}
return _cl_MI(R, 0);
}
-static cl_boolean std_zerop (cl_heap_modint_ring* R, const _cl_MI& x)
+static bool std_zerop (cl_heap_modint_ring* R, const _cl_MI& x)
{
- unused R;
+ cl_unused R;
return zerop(x.rep);
}
if (eq(g,1))
return cl_MI(R, (minusp(u) ? u + R->modulus : u));
if (zerop(xr))
- cl_error_division_by_0();
+ throw division_by_0_exception();
return cl_notify_composite(R,xr);
}
if (eq(g,1))
return cl_MI(R, mod(x.rep * (minusp(u) ? u + R->modulus : u), R->modulus));
if (zerop(yr))
- cl_error_division_by_0();
+ throw division_by_0_exception();
return cl_notify_composite(R,yr);
}
{
var const uintD* n_LSDptr;
var const uintD* n_MSDptr;
- I_to_NDS_nocopy(n, n_MSDptr=,,n_LSDptr=,cl_false,);
+ I_to_NDS_nocopy(n, n_MSDptr=,,n_LSDptr=,false,);
var const uintL k_mask = bit(k)-1;
var uintD carry = 0;
var unsigned int carrybits = 0;
// Compute a = x^n_digits[nnk-1].
{
var uintL d = n_digits[nnk-1];
- if (d == 0) cl_abort();
+ if (d == 0) throw runtime_exception();
var uintL d2;
if (k <= 8)
d2 = ord2_table[d];
if (d==0 && maxodd > 1 && d2>0) {
a = x2; d2--;
}
- if (!(d2 < k)) cl_abort();
+ if (!(d2 < k)) throw runtime_exception();
for ( ; d2>0; d2--)
a = R->_square(a);
}
} else
d2 = k;
// Square d2 times.
- if (!(d2 <= k)) cl_abort();
+ if (!(d2 <= k)) throw runtime_exception();
for ( ; d2>0; d2--)
a = R->_square(a);
}