- Joined
- Jul 26, 2008
- Messages
- 1,009
Found it. It's Pow.
Last edited:
No, it uses a power series. A for() in C may very well be (in fact, has incredibly good odds of being) faster than that many multiplications in Jass.We're talking processor speed. Pow (I think, someone correct me if I'm wrong) uses a conditional loop to multiply x, which means it has to evaluate <index> conditions, or more, making it much slower than straight multiplication. If processing speed doesn't matter to you, however, feel free to use Pow, but i personally think x*x looks more organised, however I can see why anything over a power of about 4 might tempt you to use the function.
ohsh-Pow(x,y)
1/x^3.2Pow(x,-3.2)
Similar to the one above just without the "1/" and something else than 16/5Pow(x,4.142341)
Because interpreters are by definition slower than truly compiled languages?@Poot
Why the hell would JASS multiplication be that slow?
x * x is faster
@Poot
Why the hell would JASS multiplication be that slow?
Hemlock said:Correct, however when not used oftenly, don't be bothered to use the pow function inside the editor, it's nothing significant really + if you want to have x to the power of 50, you might get sore finger from clicking or typing once your done.
set i = 0
loop
exitwhen i == 50
set x = x * x
set i = i+1
endloop
Fixed.JASS:set i = 0 set i2 = x loop exitwhen i == 50 set x = x * i2 set i = i+1 endloop
Indeed.But it's still slower.
Umm, no one?And, more importantly, who cares?