GoForSmoke:
int b;
void setup()
{
b=10;
//c code
b = b ^ b;
//C Form
b = (b xor b);
// xor (used in pascal);
b = !b;
//pascal
b = not b;
b = b | b;
//pascal
b = b or b;
b = b & b;
//pascal
b = b and b;
}
void loop()
{
}
Just because it compiles doesn't always mean it's going to do what you think. Try throwing a few print statements in there, maybe we can fun over the results.
int b;
void setup()
{
Serial.begin(9600);
b=1;
//c code
b = b ^ b;
Serial.print("C Version: ");
Serial.println(b);
Serial.println();
//C Form (interesting, does ^ not mean XOR? these conflict, the
//rest (below match)
b = (b xor b);
Serial.print("Pascal Style Version: ");
Serial.println(b);
Serial.println();
// xor (used in pascal);
b = !b;
Serial.print("C Version: ");
Serial.println(b);
Serial.println();
//pascal
b = not b;
Serial.print("Pascal Style Version: ");
Serial.println(b);
Serial.println();
b = b | b;
Serial.print("C Version: ");
Serial.println(b);
Serial.println();
//pascal
b = b or b;
Serial.print("Pascal Style Version: ");
Serial.println(b);
Serial.println();
b = b & b;
Serial.print("C Version: ");
Serial.println(b);
Serial.println();
//pascal
b = b and b;
Serial.print("Pascal Style Version: ");
Serial.println(b);
Serial.println();
}
void loop()
{
}
I Think ^ is not the same as XOR but the rest seems to yeild identical values, but then my maths sucks badly, i use my fingers to count on still lol...
anyway, could someone throw it some real values to check to see what the differences actually are?