PDA

View Full Version : And, Or, & Eor


Malorie
12-09-2005, 07:40 AM
Can I use them in LScript, (bit manipulators)?

I don't see anything about them in the docs.
Malorie

Lynx3d
12-09-2005, 01:00 PM
Good question...i found this in the Reference Manual: "if(x & 1)"
Assuming that it's no typo but taken from C, that's a bitwise "and", in this case checking for odd numbers, so i guess bitwise "or" would be "|" and "xor" "^" just like in C :)

Malorie
12-09-2005, 08:31 PM
I was just writing a subroutine that I needed to turn off the MSB and tried an & and it worked as expected.

Funny that the docs say nothing about bitwise operators, wheather they can be used or not or any info on syntax. Gotta love trial and error, error, ERROR!!! :D

Oh well, I guess some things in life are just assumed. :)
Malorie