Horner's rule for polynomial evaluation: Difference between revisions

Line 80:
horner(list coeffs, real x)
{
integerreal ic, z;
real z;
 
z = 0;
 
ifor = l_length(, c of coeffs); {
while (i) { z *= x;
i - z += 1c;
z *= x;
z += l_q_real(coeffs, i);
}
 
return z;
}
 
 
integer
main(void)
{
o_plan(horner(l_effectlist(-19r, 7.0, -real(4)4r, 6r), 3), "\n");
 
return 0;
}</lang>
 
Anonymous user