All pastes #232746 Raw Edit

Function help

public text v1 · immutable
·published 2006-11-01 14:43 UTC
rendered paste body
/****************************************************************/
/*              Function: x_to_the_n			        */
/*                                                              */
/*  Purpose:    raises an integer to a positive integer power.	*/
/*                                                              */
/*  Parameters: x 	- Numbers to be raised.			*/
/*		n	- Power number is to be raised by.	*/
/*								*/
/*								*/
/****************************************************************/

	int x_to_the_n( int x, int n )
	{
		int i;
    		long int p;	

		p = 1;
    	for ( i = 1; i <= n; i++) {
      	p = p * base;
    	}
    	return( p );
	}