• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Snippet]RaiseNumberPower

[jass=]function RaiseRealNumberPower takes real r , integer p returns real
local real cr = r
local integer l
loop
exitwhen l == p + 1
set r = r * cr
set l = l + 1
endloop
if r <= 0 and cr != 0 then
set r = 1000000000
endif
return r
endfunction
//===============================================
function RaiseIntegerNumberPower takes integer i , integer p returns integer
local integer ci = i
local integer l
loop
exitwhen l == p + 1
set i = i * ci
set l = l + 1
endloop
if i <= 0 and ci != 0 then
set i = 1000000000
endif
return i
endfunction[/code]

Just a simple snippet from me.
I cant think of other names so i named it like this.

This snippet is just like squares and cubes,but limitless. :D

I used that if block because it will return negatives once the number reaches over the max value.
 
Top