Trabb Pardo–Knuth algorithm: Difference between revisions
Content added Content deleted
(Add MATLAB implementation) |
(Added Easylang) |
||
Line 1,594: | Line 1,594: | ||
</pre> |
</pre> |
||
=={{header|EasyLang}}== |
|||
<syntaxhighlight> |
|||
print "Please enter 11 numbers :" |
|||
n[] = number strsplit input " " |
|||
print "" |
|||
print "Evaluating f(x) = |x|^0.5 + 5x^3 for the given inputs :" |
|||
for i = len n[] downto 1 |
|||
r = sqrt abs n[i] + 5 * pow n[i] 3 |
|||
write "f(" & n[i] & ") = " |
|||
if r > 400 |
|||
print "Overflow!" |
|||
else |
|||
print r |
|||
. |
|||
. |
|||
# without this section, the input is interactive |
|||
input_data |
|||
10 -1 1 2 3 4 4.3 4.31 4.32 4.32 4.29 |
|||
</syntaxhighlight> |
|||
=={{header|EchoLisp}}== |
=={{header|EchoLisp}}== |