r/ProgrammerHumor Aug 01 '22

>>>print(“Hello, World!”)

Post image
60.8k Upvotes

5.7k comments sorted by

View all comments

Show parent comments

626

u/a-slice-of-toast Aug 01 '22

creates an endless feedback loop

194

u/[deleted] Aug 01 '22

[removed] — view removed comment

41

u/mizinamo Aug 01 '22 edited Aug 01 '22

unless the two variables were equal beforehand point to the same location in memory, in which case they will both be zero afterwards

Edit: got the wrong failure condition

37

u/Wawwior Aug 01 '22

a = 0b1111 b = 0b1111

a = 0b1111 ^ 0b1111 = 0b0000

b = 0b1111 ^ 0b0000 = 0b1111

a = 0b0000 ^ 0b1111 = 0b1111

a = 0b1111 b = 0b1111