Horner's rule for polynomial evaluation: Difference between revisions

m
→‎version 1: added a comment.
m (→‎version 1: added a comment.)
m (→‎version 1: added a comment.)
Line 1,468:
do j=deg-1 by -1 for deg; a=a*x+c.j /*apply Horner's rule to the equations.*/
end /*j*/
say /*display a blank line for readability.*/
say
say ' answer = ' a /*stick a fork in it, we're all done. */</lang>
'''output''' &nbsp; when the following is used for input: &nbsp; <tt> 3 &nbsp; -19 &nbsp; 7 &nbsp; -4 &nbsp; 6 </tt>