![]() |
xor and class?
I've been wondering what these do. When you type them into the compiler, they turn red like "if" and "function" do. How are they used on graal? And is there really any situation in which you would use these over alternative code?
|
xor, usually the ^ operator in other languages, is bitwise exclusive or. Compares the two inputs bit by bit, bit output is 1 if one bit is 1 and the other is 0, otherwise 0.
For example: 3 xor 5 == 6 Because: 3 == 011 5 == 101 6 == 110 Not sure if the class keyword is actually being used. |
Doesn't Graal have other logic gates? (NOT, AND, OR, NOR, XOR, XNOR, ...).
http://en.wikipedia.org/wiki/NAND_lo...ing_NAND_gates |
Quote:
|
& is bitwise and, | is bitwise or. GS2 also offers >> and << for right/left shift (respectively, duh). Not sure about others. It's possible that ! also works as bitwise negation, give it a try.
|
|
Quote:
|
All times are GMT +2. The time now is 01:20 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.