You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The compiler accepts comparison between a char CArray and a CString but it is not compiled/executed as a string comparison correctly! (results here are random).
struct Instr {
var mnem: CArray[Char, 8]; // mnemonic of op
var valF: Float32;
}
// interpret instruction
function interp(instr: Instr, stack: Ptr[Stack]) {
if (instr.mnem) == "PUSHCF " {
stack.arr[stack.idx++] = instr.valF; // push
printf("PUSH\n");
}
else if instr.mnem == "LININTER" {
var intr = stack.arr[stack.idx--];
var b = stack.arr[stack.idx--];
var a = stack.arr[stack.idx--];
stack.arr[stack.idx++] = a*(1.0-intr) + (b-a)*intr;
printf("LININTER\n");
}
}
The text was updated successfully, but these errors were encountered:
The compiler accepts comparison between a char CArray and a CString but it is not compiled/executed as a string comparison correctly! (results here are random).
The text was updated successfully, but these errors were encountered: