// cornacchia4().
// General includes.
-#include "cl_sysdep.h"
+#include "base/cl_sysdep.h"
// Specification.
#include "cln/numtheory.h"
// Implementation.
-#include "cl_I.h"
+#include "integer/cl_I.h"
namespace cln {
if (d==7) return cornacchia_t(1, 1,1);
return cornacchia_t(0);
}
- switch (FN_to_L(logand(d,7))) {
+ switch (FN_to_V(logand(d,7))) {
case 0: case 4: {
// d == 0 mod 4
var cornacchia_t s = cornacchia1(d>>2,p);
if (init.condition)
return init.condition;
if (init.solutions != 2)
- cl_abort();
+ throw runtime_exception();
// Compute x with x^2+d == 0 mod 4*p.
var cl_I x0 = R->retract(init.solution[0]);
if (evenp(x0)) { x0 = p-x0; } // Enforce x0^2+d == 0 mod 4.