Path: utzoo!utgpu!attcan!uunet!mcvax!philmds!leo From: leo@philmds.UUCP (Leo de Wit) Newsgroups: comp.unix.wizards Subject: Faculty of 0 (was: Re: reentrant vs. non-reentrant code) Summary: Small correction Keywords: 1 Message-ID: <572@philmds.UUCP> Date: 3 Aug 88 11:57:10 GMT References: <1670001@hpcilzb.HP.COM> <3409@phri.UUCP> <4790@pasteur.Berkeley.EDU> Reply-To: leo@philmds.UUCP (Leo de Wit) Organization: Philips I&E DTS Eindhoven Lines: 22 In article <4790@pasteur.Berkeley.EDU> anton@postgres.UUCP (Jeff Anton) writes: |/* recursive and reentrant */ |unsigned |fact1(i) |unsigned i; |{ | if (i < 3) | return(i); | return (i*fact1(i-1)); |} And roy@phri.UUCP (Roy Smith) writes in his article: | fact (i) | int i; | { | return (i<2 ? i : i*fact(i-1)); | } Both are obviously implementing a faculty function; note that the faculty of 0 is 1, not 0. Leo.