here is the code but this is madness....
the math of editor is completly nuts !!
i did set each integer to their value and did the math but the result is 1
then i tried with real result was 1.00, then i forced a order for maths operation "(a/b)*(c/d)*e-f " and result was still 1.00 !!!
i did it with a calculator a/b*c/d*e-f and result was 2.20...
if i do with calculator (a/b)*(c/d)*2-1 i also get 2.20, so order isn't important for the result, that mean it is impossible from that to determine in wich order the editor does maths...
what is crazy is that editor still say when i use real that 6/5 = 1.00 wtf ???
Code[Jass=]
//! runtextmacro variables()
// This is where you should delcare your variables
// Remember, (type) (name)
// Assignment sector:
integer a
integer b
integer c
integer d
integer e
integer f
real g
real h
real ab
real cd
//! runtextmacro endvariables()
//! runtextmacro actions()
// This is where you should put all the code that modifies
// and plays with the variables you declared above.
set a = 6
set b = 5
set c = 4
set d = 3
set e = 2
set f = 1
set ab = 6/5
set cd = 4/3
set g = a/b*c/d*e-f
set h = ab*cd*e-f
// Assignment sector:
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, "total is " + I2S(a/b*c/d*e-f))
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, "total is " + R2S(g))
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, R2S(ab)+"X "+ R2S(cd)+"X 2 - 1 = "+ R2S(h))
//! runtextmacro endactions()[/code]
the math of editor is completly nuts !!
i did set each integer to their value and did the math but the result is 1
then i tried with real result was 1.00, then i forced a order for maths operation "(a/b)*(c/d)*e-f " and result was still 1.00 !!!
i did it with a calculator a/b*c/d*e-f and result was 2.20...
if i do with calculator (a/b)*(c/d)*2-1 i also get 2.20, so order isn't important for the result, that mean it is impossible from that to determine in wich order the editor does maths...
what is crazy is that editor still say when i use real that 6/5 = 1.00 wtf ???
Code[Jass=]
//! runtextmacro variables()
// This is where you should delcare your variables
// Remember, (type) (name)
// Assignment sector:
integer a
integer b
integer c
integer d
integer e
integer f
real g
real h
real ab
real cd
//! runtextmacro endvariables()
//! runtextmacro actions()
// This is where you should put all the code that modifies
// and plays with the variables you declared above.
set a = 6
set b = 5
set c = 4
set d = 3
set e = 2
set f = 1
set ab = 6/5
set cd = 4/3
set g = a/b*c/d*e-f
set h = ab*cd*e-f
// Assignment sector:
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, "total is " + I2S(a/b*c/d*e-f))
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, "total is " + R2S(g))
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 60, R2S(ab)+"X "+ R2S(cd)+"X 2 - 1 = "+ R2S(h))
//! runtextmacro endactions()[/code]