digitalmars.D.bugs - [Issue 6965] New: [CTFE] wrong reset of variable
- d-bugmail puremagic.com (25/25) Nov 17 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6965
- d-bugmail puremagic.com (14/25) Nov 18 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6965
- d-bugmail puremagic.com (6/6) Nov 19 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6965
http://d.puremagic.com/issues/show_bug.cgi?id=6965 Summary: [CTFE] wrong reset of variable Product: D Version: D2 Platform: Other OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: dawg dawgfoto.de 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: -------
Nov 17 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6965 Don <clugdbug yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |clugdbug yahoo.com.au Resolution| |INVALID That fails at run time, too. You're multiplying by zero! Should be: while(--n)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: -------
Nov 18 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6965 Oops. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 19 2011