How are unsigned numbers stored?

I know, signed numbers are stored using two’s complement representation

Unsigned numbers are stored using a simple binary representation, where each bit represents a value from 0 to 1. Is it true? Am I right?

Yes.

Note that the bytes might be stored in big endian or little endian order, dependingo on the platform.

See also to_ne_bytes, to_be_bytes, to_le_bytes, from_ne_bytes, etc.

3 Likes

Thanks)

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.