Min integer value in 32bit representation

5 views
Skip to first unread message

Rahul Patel

unread,
Aug 29, 2018, 12:51:56 PM8/29/18
to fundamental...@googlegroups.com
I have simple question related to representation of negative number.
What "valid" minimum integer value can hold by 32bit signed datatype?
Is it -2147483648 (0x80000000) or -2147483647 (0x80000001)? If we do
2's compliment in 32bit then both represent same value.

--
Rahul Patel

Mitesh Koradia

unread,
Aug 29, 2018, 10:46:02 PM8/29/18
to fundamental...@googlegroups.com
The minimal number in two's complement notation is 0x80000000-2147483648. The interesting fact about this number is that it is equal to its own complement, i.e. inverting all bits results in 0x7FFFFFFF and adding 1 yields 0x80000000, which is equal to the original number.

Source: stackoverflow 

--
-- Owner of this group do not accept ANY liability for the views expressed in the email or for the consequences of any computer viruses that may be transmitted with this email. Owner is not responsible for any kind of copyright violations or infringements caused/posted by any user of the group. Messages are posted through moderation also does not include any kind of verification against copyright violations or infringements.
---
You received this message because you are subscribed to the Google Groups "insane" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fundamental-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Thanks
Mitesh Koradia
http://www.miteshkoradia.co.in

Reply all
Reply to author
Forward
0 new messages