Why is abs(0x80000000) == 0x80000000?

Posted by sigjuice on Stack Overflow See other posts from Stack Overflow or by sigjuice
Published on 2010-03-29T15:34:33Z Indexed on 2010/03/29 15:43 UTC
Read the original article Hit count: 191

Filed under:
|
|
|

I just started reading Hacker's Delight and it defines abs(-231) as -231. Why is that?

I tried printf("%x", abs(0x80000000)) on a few different systems and I get back 0x80000000 on all of them.

© Stack Overflow or respective owner

Related posts about c

    Related posts about bit-manipulation