Fibonacci sequence: Difference between revisions

→‎{{header|D}}: Fixed English
(+D)
(→‎{{header|D}}: Fixed English)
Line 39:
 
=={{header|D}}==
Here are four versionversions of Fibonacci Number generating functions.<br>
''FibD'' has an argument limit of magnitude 82 due to floating point precision, the others have a limit of 92 due to overflow (long).<br>
The traditional recursive version is inefficient. It is optimized by supplying a static storage to store intermediate results.<br>
All four functions have extendedsupport to deal withfor negative argumentarguments.
<d>module fibonacci ;
import std.stdio ;
Line 96:
I : 99194853094755497 <- 61305790721611591 + 37889062373143906
O : 99194853094755497 <- 61305790721611591 + 37889062373143906</pre>
 
=={{header|Forth}}==
: fib ( n -- fib )
Anonymous user