Rust for Python Developers - Unsigned, Signed Integers and Casting

Shin_O
1,309 views

Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content

This story was originally published on Medium

Follow me:

Ones' Complement

The first bit (MSB) is the same as the signed magnitude. It tells a positive by 0 or negative by 1.

The rest of the bits will take the compliment, which means if it is 1 the complement is 0 and if it is 0, then the complement is 1.

4-bit-word-2

The signed ones’ complement has the same problem as the signed magnitude. There are two zeros, 0000 and 1111.

Open Source Your Knowledge: become a Contributor and help others learn. Create New Content