Copy link
@jibsen

jibsen Aug 22, 2016

I guess technically, since the unsigned long value is outside the range of long, the result of the cast back to long is implementation defined (C11 6.3.1.3p3).

What about -(1L << 16), as suggested here?