home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Borland Programmer's Resource
/
Borland_Programmers_Resource_CD_1995.iso
/
utils
/
mathstud
/
fac.m
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1995-05-19
|
269 b
|
16 lines
function [y]=fac(n)
% y=fac(n)
% computes n factorial (demonstrate a recursive function call)
% n should be a positive integer
% S.Halevy 7/31/92
% Copyright (c) 1992 by the MathWizards
if (n<=1)
y=n;
return
end
y=n*fac(n-1);