if (eq(g,1))
return cl_MI(R, mod((minusp(u) ? u + R->modulus : u) << (2*R->n), R->modulus));
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->n, R->modulus));
if (zerop(yr))
- cl_error_division_by_0();
+ throw division_by_0_exception();
return cl_notify_composite(R,yr);
}
CL_ALLOCA_STACK;
var uintC len;
var const uintD* M_LSDptr;
- I_to_NDS_nocopy(M, ,len=,M_LSDptr=,cl_false,);
+ I_to_NDS_nocopy(M, ,len=,M_LSDptr=,false,);
if (lspref(M_LSDptr,len-1)==0) { len--; } // normalize
// Compute U as 2-adic inverse of M.
var uintD* U_LSDptr;
var uintC i_min;
var uintC i_max;
var uintC i = floor(m,2);
- var cl_boolean negative;
+ var bool negative;
if (U_bit(i)) {
for (; --i > 0; )
if (!U_bit(i)) break;
for (; ++i < m; )
if (!U_bit(i)) break;
i_max = i;
- negative = cl_true;
+ negative = true;
} else {
for (; --i > 0; )
if (U_bit(i)) break;
for (; ++i < m; )
if (U_bit(i)) break;
i_max = i;
- negative = cl_false;
+ negative = false;
}
#undef U_bit
// OK, all the bits i_max-1..i_min of U are equal.
var cl_I U = DS_to_I(U_LSDptr lspop U_len,U_len);
var cl_I V_N = 1 - U*M;
if (ldb_test(V_N,cl_byte(n,0)))
- cl_abort();
+ throw runtime_exception();
var cl_I V = V_N >> n;
return new cl_heap_modint_ring_montgom(M,m,n,V);
}