• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Snippet]RaiseNumberPower

Level 33
Joined
Apr 24, 2012
Messages
5,099
[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.
 
Back
Top