Square form factorization: Difference between revisions

m
no edit summary
m (→‎{{header|Phix}}: added syntax colouring the hard way)
mNo edit summary
Line 230:
if ((N & 1)==0) return 2;
 
h = floor(sqrt(N) + 0.5);
if (h * h == N) return h;
 
Line 249:
 
//iteration bound
ix = floor(sqrt(2*r)) * 24;
 
//search principal cycle
for (i = 2; i < ix; i ++= 2) {
rho(a, b, c)
//even step
 
r = floor(sqrt(c)+ 0.5);
if (r * r == c) {
//square form found