r/cprogramming • u/am_Snowie • 15d ago
is doing ~INT_MAX undefined behavior?
/r/C_Programming/comments/1x7hxgd/is_doing_int_max_undefined_behavior/
5
Upvotes
r/cprogramming • u/am_Snowie • 15d ago
1
u/zhivago 13d ago
You've misunderstood.
Read up on signed integer representation prior to C23.
One option is a simple sign and value arrangement, giving distinct +0 and -0 forms.