home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 1 / FishNMoreVol1.bin / more / code_examples / librar / lpower.c < prev    next >
Text File  |  1989-02-08  |  602b  |  29 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 long int. result of the    */
  11. /*        calculation.        */
  12. /* Author: John Callicotte        */
  13. /* Date created/modified: 10/04/88    */
  14. /*                    */
  15. /*--------------------------------------*/
  16.  
  17. long lpower(a,b)
  18. int a,b;
  19. {
  20.     int j;
  21.     long d;
  22.     d=1L;
  23.     if (b){            /* Check for 0 mantissa. */
  24.           for (j=0;j<b;j++)
  25.                  d*=(long)a;
  26.     }
  27.     return(d);
  28. }
  29.