[Issue 6965] [CTFE] wrong reset of variable

2011-11-19 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6965



--- Comment #2 from d...@dawgfoto.de 2011-11-19 12:07:40 PST ---
Oops.

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


[Issue 6965] [CTFE] wrong reset of variable

2011-11-18 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6965


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||clugd...@yahoo.com.au
 Resolution||INVALID


--- Comment #1 from Don clugd...@yahoo.com.au 2011-11-18 13:07:40 PST ---
That fails at run time, too. You're multiplying by zero!
Should be:   while(--n)

(In reply to comment #0)
 size_t fac(size_t n)
 {
 size_t res = n;
 while (n--)
 res *= n;
 return res;
 }
 
 static assert(fac(3) == 6);
 
 --

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