home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 1 / FishNMoreVol1.bin / more / code_examples / librar / power.c < prev    next >
Text File  |  1989-02-08  |  579b  |  28 lines

  1. /*--------------------------------------*/
  2. /*                    */
  3. /*                POWER(X,X)        */
  4. /*                    */
  5. /* Functionality:            */
  6. /*    Exponential calculations.    */
  7. /* Arguments:                */
  8. /*     0: The base number        */
  9. /*    1: The mantissa            */
  10. /* Returns: An integer result of the    */
  11. /*        calculation.        */
  12. /* Author: John Callicotte        */
  13. /* Date created/modified: 09/01/88    */
  14. /*                    */
  15. /*--------------------------------------*/
  16.  
  17. power(a,b)
  18. int a,b;
  19. {
  20.     int d,j;
  21.     d=1;
  22.     if (b){            /* Check for 0 mantissa. */
  23.           for (j=0;j<b;j++)
  24.                  d*=a;
  25.     }
  26.     return(d);
  27. }
  28.