|
|
Edited by Omegal on 9/28/11 10:26 PM (PDT)
In 4.3 PTR it appears dividing by 0 is no longer working
so local inf = 1/0 or local serNaN = tostring(0/0) or other similar number or hacks. A lot of mods are using these and they are not functional on PTR. Intended change, or just a bug, don't know yet. Have to wait and see what blizzard says about this. |
|
Edited by Rubyheart on 9/28/11 12:59 AM (PDT)
At this stage of the PTR, I don't think any addons even get loaded. (Unless they're all just marked "out of date" and you have to hit the box again and I forgot.)
And X/0 is not infinity. In fact it's not even possible to compute. And what possible reason could you have for including something like this in an addon? |
|
|
Stat calculations, averages, etc. and relying on it silently failing. Also, you already get errors when dividing by zero if you output the results. E.g. print(1/0) -- prints "1.#INF". Lua does not throw errors when dividing by zero, so it's likely Blizzard debugging code has been enabled, they will probably disable it later on. ___________________________ <<It doesn't work the way I want it to, so it must be bugged.>> |
|
|
actually toc on current build was still 40200 so it loaded addons without "load out of date" which is another oversight i'm sure. every mod not using divide by 0 is actually working flawlessly.
|
|
|
A few libs are affected, so a lot of other mods are affected indirectly. They will nil out when they try to call functions fromt he libs. such as bugsack failing because it can't work right with ace serializer.
|
|
|
local serNaN = tostring(math.log(-1))
local serInf = tostring(math.huge) local serNegInf = tostring(-math.huge) seems to do the job for now |
|
|
Edited by Omegal on 9/28/11 1:53 PM (PDT)
local inf = math.huge
fixes libcrayon but same fix in libtourist hangs the UI in deadlock, sigh. |
|
|
found this useful
http://www.gammon.com.au/scripts/doc.php?general=lua_math |
|
|
Does math.log(-1) actually work in your PTR client? It crashes mine with a FLT_INVALID_OPERATION exception, even with the scriptProfile CVar off.
It looks like floating point overflow also causes the game to crash: local a=1000^1000; -- FLT_OVERFLOW |
|
Edited by Farmbuyer on 9/28/11 7:20 PM (PDT)
And X/0 is not infinity. In fact it's not even possible to compute. They're not trying to actually get a numerical answer that you could count to. I recommend doing some googling on floating-point math, NaNs, normalized and denormalized numbers and their representations, etc. |
Quick sanity check: what does "Lua 5.1" |
|
|
Edited by Omegal on 9/28/11 11:24 PM (PDT)
Does math.log(-1) actually work in your PTR client? It crashes mine with a FLT_INVALID_OPERATION exception, even with the scriptProfile CVar off. http://www.mysticalos.com/nan.jpg yeah works for me ^ (see screen shot), mac client. 64bit OS X lion boot. No crashes at all, and the mods that were using it started working gloriously again when applying my changes. I dunno. i only tried it in ace serializer though. looks like someone redirected this to PTR bug forum. is that a blue confirming it's not intended then? Some have speculated 4.3 might have updated the lua compiler to a JIT one or something, which could have caused an issue like this to crop up. it'd be a step in right direction to use an optimized compiler instead of just interpreting lua byte code. such a bug can only happen if you are doing some very smart optimizations |
|
|
Why are you people trying to divide by zero anyhow?
Have you SEEN the result? It's not pretty. |
