Fibonacci with ranges

teo teo.ubuntu at yahoo.com
Fri Mar 11 15:12:50 PST 2011


Just curious: How can I get ulong here?

foreach (f; take(recurrence!("a[n-1] + a[n-2]")(0, 1), 50))
{
	writeln(f);
}

Results:
0
1
1
2
3
5
8
..
1134903170
1836311903
-1323752223
512559680
-811192543


More information about the Digitalmars-d-learn mailing list