home *** CD-ROM | disk | FTP | other *** search
- {<<<< Factorial >>>>}
- { From: COMPLETE TURBO PASCAL by Jeff Duntemann }
- { Scott, Foresman & Co. 1986 ISBN 0-673-18600-8 }
- { Described in section 14.4 -- Last mod 2/1/86 }
- { Overflows for all N > 7 }
-
- FUNCTION Factorial(N : Integer) : Integer;
-
- BEGIN
- IF N > 1 THEN Factorial := N * Factorial(N-1)
- ELSE Factorial := 1
- END;