Prev: Is there a moderated comp.theory
Next: CodeWarrior begins on Mar 5, 06:00 pm IST. Certificates & Prizes worth 20,000 INR.
From: M. M i c h a e l M u s a t o v on 3 Mar 2010 18:45 on long factorial(int n) {0 result = 1; while (n != 0) { result = result * n; n = n - 1; } return result; }
From: Ostap S. B. M. Bender Jr. on 4 Mar 2010 06:35 On Mar 3, 3:45 pm, "M. M i c h a e l M u s a t o v" <marty.musa...(a)gmail.com> wrote: > on long factorial(int n) {0 > result = 1; > while (n != 0) { > result = result * n; > n = n - 1; > } > return result; > > } > This man is a genius!
From: scattered on 4 Mar 2010 11:57 On Mar 3, 6:45 pm, "M. M i c h a e l M u s a t o v" <marty.musa...(a)gmail.com> wrote: > on long factorial(int n) {0 > result = 1; > while (n != 0) { > result = result * n; > n = n - 1; > } > return result; > > > > }- Hide quoted text - > > - Show quoted text - cool: (-1)! = stack overflow
From: scattered on 4 Mar 2010 11:59
On Mar 4, 11:57 am, scattered <sortofbutnotrea...(a)gmail.com> wrote: > On Mar 3, 6:45 pm, "M. M i c h a e l M u s a t o v" > > <marty.musa...(a)gmail.com> wrote: > > on long factorial(int n) {0 > > result = 1; > > while (n != 0) { > > result = result * n; > > n = n - 1; > > } > > return result; > > > }- Hide quoted text - > > > - Show quoted text - > > cool: (-1)! = stack overflow on second thought, (-1)! never halts but doesn't consume memory - so it *is* simpler. On some implementations it might wrap around and get to 0 eventually |