• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

[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