Exponents in JASS, halp!

Soulshadow

New Member
Reaction score
6
Okay, I'm trying to learn some basic JASS, starting with mathematical expressions. I got so far that to do addition subtraction multiplication and division you simply use the keys that refer to those expressions (+,-,*,/ respectfully). However, (^) does not seem to work for powers. Here's an example of the line of code that is failing to work and what I need.
Code:
private function Damage takes unit u returns real
        return 20. * SpellLevel(u) + 50. * (SpellLevel(u) ^ 1.4)
    endfunction

The formula for damage is 20X+50*(1.4^X).
 

Tyman2007

Ya Rly >.
Reaction score
74
I never quite understood why they had to make it so complicated..

If they can add in the multiplication symbol (Since all it is is just 2+2+2+2.. etc.)

Why can't they add in a power symbol? (Oh my god! It's multiplying them instead of adding! Nope, can't be done)

Just shows how lazy blizzard is some time.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top