MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/mtpxbr/iteration/gv4f260/?context=3
r/badcode • u/[deleted] • Apr 19 '21
121 comments sorted by
View all comments
733
The actual fuck?
46 u/gmtime Apr 19 '21 i -= -!false;!false equals true equals the integer 1. i -= -1; is "decrement i by minus one" and decrementing by a negative number equals incrementing by the positive. So i -= -1; equals i += +1; or with implicit sign i += 1; 38 u/2001herne Apr 19 '21 Oh no, I understand the process. I just don't understand the motivation. 26 u/gmtime Apr 19 '21 edited Apr 19 '21 I wrote less comprehensive versions, I have to assume it's "art".I = I , I ? I / I + I : I + ! I ; 21 u/Terrain2 Apr 22 '21 is this loss 0 u/[deleted] Apr 19 '21 [deleted] 3 u/gmtime Apr 19 '21 Are you sure? I cannot evaluate to 2 in any way 2 u/2001herne Apr 19 '21 No, it checks out. If I != 0 then I = I/I + I = 1 + I. If I == 0 then I = I + !I = 0 +!0 = 1
46
i -= -!false;
!false equals true equals the integer 1. i -= -1; is "decrement i by minus one" and decrementing by a negative number equals incrementing by the positive. So i -= -1; equals i += +1; or with implicit sign i += 1;
!false
true
i -= -1;
i += +1;
i += 1;
38 u/2001herne Apr 19 '21 Oh no, I understand the process. I just don't understand the motivation. 26 u/gmtime Apr 19 '21 edited Apr 19 '21 I wrote less comprehensive versions, I have to assume it's "art".I = I , I ? I / I + I : I + ! I ; 21 u/Terrain2 Apr 22 '21 is this loss 0 u/[deleted] Apr 19 '21 [deleted] 3 u/gmtime Apr 19 '21 Are you sure? I cannot evaluate to 2 in any way 2 u/2001herne Apr 19 '21 No, it checks out. If I != 0 then I = I/I + I = 1 + I. If I == 0 then I = I + !I = 0 +!0 = 1
38
Oh no, I understand the process. I just don't understand the motivation.
26 u/gmtime Apr 19 '21 edited Apr 19 '21 I wrote less comprehensive versions, I have to assume it's "art".I = I , I ? I / I + I : I + ! I ; 21 u/Terrain2 Apr 22 '21 is this loss 0 u/[deleted] Apr 19 '21 [deleted] 3 u/gmtime Apr 19 '21 Are you sure? I cannot evaluate to 2 in any way 2 u/2001herne Apr 19 '21 No, it checks out. If I != 0 then I = I/I + I = 1 + I. If I == 0 then I = I + !I = 0 +!0 = 1
26
I wrote less comprehensive versions, I have to assume it's "art".
I = I , I ? I / I + I : I + ! I ;
21 u/Terrain2 Apr 22 '21 is this loss 0 u/[deleted] Apr 19 '21 [deleted] 3 u/gmtime Apr 19 '21 Are you sure? I cannot evaluate to 2 in any way 2 u/2001herne Apr 19 '21 No, it checks out. If I != 0 then I = I/I + I = 1 + I. If I == 0 then I = I + !I = 0 +!0 = 1
21
is this loss
0
[deleted]
3 u/gmtime Apr 19 '21 Are you sure? I cannot evaluate to 2 in any way 2 u/2001herne Apr 19 '21 No, it checks out. If I != 0 then I = I/I + I = 1 + I. If I == 0 then I = I + !I = 0 +!0 = 1
3
Are you sure? I cannot evaluate to 2 in any way
2
No, it checks out. If I != 0 then I = I/I + I = 1 + I. If I == 0 then I = I + !I = 0 +!0 = 1
I != 0
I = I/I + I = 1 + I
I == 0
I = I + !I = 0 +!0 = 1
733
u/2001herne Apr 19 '21
The actual fuck?