Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
1MachineElf
on Jan 18, 2021
|
parent
|
context
|
favorite
| on:
That XOR Trick (2020)
n00b question: What is the ^= operator, and what language is it from?
valvar
on Jan 18, 2021
|
next
[–]
It's bitwise XOR in C (and most other languages, I guess).
https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B#Bit...
detaro
on Jan 18, 2021
|
prev
[–]
x ^= y is the same as x = x ^ y, with ^ being XOR. Bunch of languages have it, e.g. C, C++, Java, ...
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: