Horner's rule for polynomial evaluation: Difference between revisions
Content added Content deleted
m (→{{header|Objective-C}}: modernize) |
(+ МК-61) |
||
Line 746: | Line 746: | ||
horner(X, Cs) = list.foldr((func(C, Acc) = Acc * X + C), Cs, 0). |
horner(X, Cs) = list.foldr((func(C, Acc) = Acc * X + C), Cs, 0). |
||
</lang> |
</lang> |
||
=={{header|МК-61/52}}== |
|||
<lang>ИП0 1 + П0 |
|||
ИПE ИПD * КИП0 + ПE |
|||
ИП0 1 - x=0 04 |
|||
ИПE С/П</lang> |
|||
''Input:'' Р1:РС - coefficients, Р0 - number of the coefficients, РD - ''x''. |
|||
=={{header|Objective-C}}== |
=={{header|Objective-C}}== |