Warcraft III resources & community, 2003–2006 · archived

IntExp

not rated
Submitted by AIAndyCalculations0 downloads
Returns base^expo as an exact integer value.

Source

function IntExp takes integer base, integer expo returns integer
  if expo == 0 then
    return 1
  elseif (expo / 2) * 2 == expo then
    return IntExp(base*base,expo/2)
  else
    return base * IntExp(base, expo - 1)
  endif
endfunction

Comments

0

No comments.