Fibonacci numbers in Wolfram Mathematica
Example for versions
Mathics 0.5,
Wolfram Mathematica 8.0.4
Print
always outputs a newline after the output, so to prints the numbers in a single line, one has to accumulate them into a string and print it. <>
is concatenation operator, it works only on strings, so the result of Fibonacci
call must be converted to string explicitly using ToString
function.
msg = "";
Do[msg = msg <> ToString[Fibonacci[i]] <> ", " , {i, 16} ];
Print[msg, "..."];
Comments
]]>blog comments powered by Disqus
]]>