Jump to content

Trabb Pardo–Knuth algorithm: Difference between revisions

Added Easylang
(Add MATLAB implementation)
(Added Easylang)
Line 1,594:
</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}}==
2,044

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.