1.4.4.16 Fract_Power Function

uint32_t Fract_Power( uint16_t nBase, uint16_t nExponent )

Summary

Computes pow(nBase,nExponent) using for loop.

Description

Computes pow(nBase,nExponent) using for loop.

Preconditions

None

Returns

pow(nBase,nExponent), this must fit into a 32 bit unsigned integer.

Remarks

None

Example

uint16_t nBase, nExponent;

uint32_t answer;

nBase = 5;

nExponent = 3;

answer = Fract_Power(nBase,nExponent);

_// Answer = pow(5,3) = 125 = 0x007D_

C

uint32_t Fract_Power (uint16_t nBase , uint16_t nExponent );