Mathematical limits of Frozen Throne and Warcraft III

Ouguiya

New Member
Reaction score
11
Hello everyone!

The questions are really quick and simple, although I haven't been able to find an answer so far...

First: Can Warcraft III (in the GUI) use the Exponential function? With that, I mean euler's number: e^(x), which would come in very handy. (I have seen all sorts of stuff not really needed, like arctan and such, but not the exponential function).

Second: What is the overflow and underflow limit of Warcraft? Since it's a 32 bit application, I would suppose that it is 10^38 (since 1 bit is needed for the sign, 8 bits for the exponent and 23 bits are used for the mantissa), and likewise, the smallest number would be 10^-39.

Thanks in advance!

Yours,

Ouguiya
 

XeNiM666

I lurk for pizza
Reaction score
138
Yes, wc3 can use the exponential function but in JASS. Not sure in GUI

Trigger:
  • Custom Script: call Pow( 10, 32 )

Its 10^32
 

Ouguiya

New Member
Reaction score
11
Hello again!

I think you misunderstood. Calculating something "x to the power of y" is something which the GUI can do (thank blizzard for that one...)

However, what i have not seen yet, is the Exponential function, (it's just a name), which is e^x, where "e" is Euler's number: 2.718...

Check this Wikipedia article for more detail: http://en.wikipedia.org/wiki/Exponential_function (it's actually a REALLY important function in mathematics).

The function which I will need to use, as it is so important, uses an Exponential function, so it would come in real handy to have it ready.

Thanks

Yours,

Ouguiya
 

uberfoop

~=Admiral Stukov=~
Reaction score
177
Well, there's no native specifically for e^x, but you can always do it with Pow(2.7183,x) or something.

...I'm not sure I understand what you're asking.
 

wellwish3r

wishes wells.
Reaction score
52
Actually, there's even a bj_E constant for it, which is set to 2.71828. Dunno if you can access it from GUI. :)

you can.

I think you can only use numerical values in wc3 (similar to a graphing calculator), for example looping from 0-100 gives you all the values in whatever steps you need it (i.e. make i a real and only add 0.2 (i think only possible in JASS) every loop). Doing it like that should be dynamic enough to fit most purposes, however, not 100% exact.
 

Ouguiya

New Member
Reaction score
11
Hello all!

Thanks very much for answering the first question. I will try to use the constant then.

I have to admit though, that I do not really understand what wellwih3r said.

Unfortunatly, the functions I use have to directly use things like e^(-15) or something similar.

Thus, making loops and adding numbers is not an option here, if that was what you were suggesting.

Thanks again

Yours

Ouguiya
 

warden13

New Member
Reaction score
32
You can have infinite Real value. But you may have only (2^31 - 1).
That is equal to 2 147 483 647.
That is because of 32-bit system.
 

Ouguiya

New Member
Reaction score
11
Are you certain that this is the limit?


If I remember my professor in informatics correctly, the way computers work is this:

The computer has 32 bits.

A number can be written as: x*y^z

In the exponent (z) one bit has to be used for the sign.
Since 8 bits are used for the exponent, the maximal exponent is made out of 7 bits, which is: 2^(8-1) - 1= 128 -1 = 127

Next, the mantissa, this is what is expandable. (y). In the case of 32 bits, 23 are used for the mantissa, which amounts to a maximum of 2^-23 for the precision.

thus, the maximal floating point number is: 1 * 2^127 which equals about 10^38.

There's more to this, like which is the smallest diffrence between two numbers etc, but that is beside the point.

The only thing I actually wanted to know, is if Warcraft has any limits of it's own or becomes incredibly laggy or anything of the sort.

Thanks for the answer.

Yours,

Ouguiya
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top