Re: [Epic] Will it, won't it...

From: Alan E & Carmel J Brain <aebrain_at_...>
Date: Thu, 01 Oct 1998 18:57:15 +1000

Chris Pinson wrote:
>
> That's easy ....
>
> (Hot Potato)! = HotPotato x (HotPotato - 1)!
>
>
> > What's the factorial of a hot potato?

function FACTORIAL ( OfInteger : Natural ) return Positive is

begin

  if OfInteger = 0 then
    return 1;
  else
    return OfInteger * FACTORIAL( OfInteger - 1 );
  end if;

end FACTORIAL;

Is the general (recursive) factorial function.
-- 
aebrain_at_...     <> <>    How doth the little Crocodile
| Alan & Carmel Brain|      xxxxx       Improve his shining tail?
| Canberra Australia |  xxxxxHxHxxxxxx _MMMMMMMMM_MMMMMMMMM
 abrain_at_...  o OO*O^^^^O*OO o oo     oo oo     oo  
                    By pulling MAERKLIN Wagons, in 1/220 Scale
Received on Thu Oct 01 1998 - 08:57:15 UTC

This archive was generated by hypermail 2.3.0 : Tue Oct 22 2019 - 13:10:55 UTC