[Issue 7646] bug in code sample and unittest

2012-06-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7646


josvanu...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID


--- Comment #3 from josvanu...@gmail.com 2012-06-04 07:16:19 PDT ---
It turns out some people regard F0 = 0 and some F0 = 1. So it's not a bug after
all.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 7646] bug in code sample and unittest

2012-03-11 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7646



--- Comment #2 from josvanu...@gmail.com 2012-03-11 04:24:44 PDT ---
ulong fib (ulong n) { 
alias memoize!fib mfib; 
return n  2 ? n : mfib(n - 2) + mfib(n - 1); 
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 7646] bug in code sample and unittest

2012-03-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7646


josvanu...@gmail.com changed:

   What|Removed |Added

   Priority|P2  |P5


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 7646] bug in code sample and unittest

2012-03-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7646



--- Comment #1 from josvanu...@gmail.com 2012-03-04 12:08:27 PST ---
(In reply to comment #0)
 I think the code should be (n = 2):
 
 ulong fib(ulong n) { 
 alias memoize!fib mfib; 
 return n = 2 ? 1 : mfib(n - 2) + mfib(n - 1); 
 }
 
 assert(fib(10) == 55); 

No, that still won't do. This is better:

ulong fib(ulong n) { 
alias memoize!fib mfib; 
return n = 2 ? n != 0 : mfib(n - 2) + mfib(n - 1); 
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---