mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
some fixes to ^ operator
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1014 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+18
-3
@@ -403,10 +403,25 @@ void instrBinary (BinaryInstructionType i, ScriptValueP& a, const ScriptValueP&
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case I_POW:
|
case I_POW:
|
||||||
if (at == SCRIPT_DOUBLE || bt == SCRIPT_DOUBLE) {
|
if (bt == SCRIPT_INT) {
|
||||||
a = to_script(pow((double)*a, (double)*b));
|
int bi = *b;
|
||||||
|
if (at == SCRIPT_DOUBLE) {
|
||||||
|
double aa = *a;
|
||||||
|
if (bi == 0) a = to_script(1);
|
||||||
|
else if (bi == 1) a = to_script(aa);
|
||||||
|
else if (bi == 2) a = to_script(aa * aa);
|
||||||
|
else if (bi == 3) a = to_script(aa * aa * aa);
|
||||||
|
else a = to_script(pow(aa,bi));
|
||||||
|
} else {
|
||||||
|
int aa = *a;
|
||||||
|
if (bi == 0) a = to_script(1);
|
||||||
|
else if (bi == 1) a = to_script(aa);
|
||||||
|
else if (bi == 2) a = to_script(aa * aa);
|
||||||
|
else if (bi == 3) a = to_script(aa * aa * aa);
|
||||||
|
else a = to_script(pow(aa,bi));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
a = to_script(pow((int)*a, (int)*b));
|
a = to_script(pow((double)*a, (double)*b));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case I_AND: OPERATOR_B(&&);
|
case I_AND: OPERATOR_B(&&);
|
||||||
|
|||||||
Reference in New Issue
Block a user