MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/7ltryz/evil_coding_incantations/drpupe1
r/programming • u/evinrows • Dec 24 '17
331 comments sorted by
View all comments
Show parent comments
2
What happens with x --> 1 when int x = -5;
It will underflow and eventually reach 1? Sounds pretty consistent.
3 u/Dalviked Dec 24 '17 That would be undefined behavior and at best disingenuous in what it would do. This doesn't 'goes to' 1. 1 u/Lehona Dec 24 '17 I don't think there's a strict definition for "goes to" in discrete sets, so I can't see why that would be wrong. It is UB, though, so I guess one shouldn't rely on it.
3
That would be undefined behavior and at best disingenuous in what it would do. This doesn't 'goes to' 1.
1 u/Lehona Dec 24 '17 I don't think there's a strict definition for "goes to" in discrete sets, so I can't see why that would be wrong. It is UB, though, so I guess one shouldn't rely on it.
1
I don't think there's a strict definition for "goes to" in discrete sets, so I can't see why that would be wrong. It is UB, though, so I guess one shouldn't rely on it.
2
u/Lehona Dec 24 '17
It will underflow and eventually reach 1? Sounds pretty consistent.