Annotation of researchv10no/cmd/basic/bite/src/fact.c, revision 1.1.1.1

1.1       root        1: 
                      2: /* Copyright Bell Telephone Laboratories Whippany, N.J.
                      3: 
                      4:  *     /////////////////////////////////////
                      5:  *     /////////////////////////////////////
                      6:  *     ////////////// fact.c ///////////////
                      7:  *     /// J. P. Hawkins WH X4610 8C-001 ///
                      8:  *     ///// Tue Apr 21 16:39:20 1981 //////
                      9:  *     /////////////////////////////////////
                     10:  *     /////////////////////////////////////
                     11:  *     @(#) fact.c: V1.2 4/22/81
                     12:  * Factorial function
                     13: 
                     14: */
                     15: 
                     16: #include       "bas.h"
                     17: double
                     18: fact(n)
                     19: double  n;
                     20: {
                     21:         long    l;
                     22:         double  fact();
                     23:         l = n;
                     24:        if(l>33 || l<0L)
                     25:        {
                     26:                error(inst.thing.linno, 56);
                     27:                return(0.0);
                     28:        }
                     29:         if(l == 0 || l == 1)
                     30:                 return(1.0);
                     31:         else
                     32:                 return(l*fact(l-1.0));
                     33: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.