cast_unsigned
No overview available.
def cast_unsigned(
value: int,
bit_length: int
) - > int
Converts a signed integer to its unsigned representation based on a specified bit length. This is typically used to simulate hardware register behavior or to prepare values for low-level binary protocols.
Parameters
| Name | Type | Description |
|---|---|---|
| value | int | The signed integer value to be converted. |
| bit_length | int | The number of bits used to represent the integer, which determines the wrap-around threshold for the conversion. |
Returns
| Type | Description |
|---|---|
int | The unsigned integer value resulting from the bitwise conversion. |