Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Aspect Script function for calculating exponents (exponentiate) 1

Status
Not open for further replies.

dhazer

Programmer
Oct 20, 2006
48
Thread thread448-392425 wanted a function for exponential calculations, so here's one for the archive:

func exponentiate : integer
param integer base
param integer exponent
integer counter, tempbase


tempbase = 1

if exponent == 0
return 1

elseif exponent == 1
return base
else
for counter = 1 upto exponent
tempbase = tempbase * base
endfor
endif

return tempbase

endfunc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top