While loop for reals

Status
Not open for further replies.
Level 3
Joined
Apr 28, 2010
Messages
48
sounds like a hipster thing to say but,...

Does it call every real number in the while, or the other trigger, for each real? OR, does it round to an integer.

I can't imagine blizzard would let people mess with infinite numbers.
 
There will obviously be an incriment setting for it, as you would otherwise have near meaningless values.

SC2 uses floats, their precision I do not know. They however definatly do have a precision so there is no infinite number of reals. Additionally the range of numbers supported by floats vary with there being huge incriments at large numbers.
 
The real value for loop should have an increment setting. It increases the variable by the increment until it is greater than the exit condition.

Blizzard doesn't prevent you from using infinite loops, if that's what you are asking. If you want to crash your map and make it freeze, your choice.
 
real numbers associated with game time are rounded to the nearest multiple of 0.0625

some reals in the data editor are also rounded to 1/16 or 1/32 increments as well. you can see some values when you enter 1000, it rounds it to like 999.94
 
I would imagine they used floats as those are what direct X and such interfaces use and also modern hardware actually supports physical structures to speed up their computation.

They might use binary decimalls as well, which would explain the funny incriment (caused by maths applied) but only a reverse engineering of the actual game would reveal that (which violates TOU).
 
Floats? I thought they used fixed-point variables. At least that's what they are called...
Fixed point suggests integers.

I'm pretty sure they use 32 bit floats for "fixed" variables. I mean forcing us to use 64 bit variables would be kind of silly, and the memory allocation problem (the 2^21 bit limit) seems to be the same regardless of if you are using int vs fixed, so it suggests they use the same storage capacity ie 4 bytes.
 
Status
Not open for further replies.
Back
Top