mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 11:10:14 +01:00
Clarify possible uses of uint
@@ -264,7 +264,12 @@ int() casting is very fast in viper code.
|
||||
|
||||
## The viper uint data type
|
||||
|
||||
This data type is in most aspects similar to viper `int` but the range is 0 to 2\*\*32-1, i.e. it's a unsigned 32 bit integer.
|
||||
This data type is in most aspects similar to viper `int` but the range is 0 to 2\*\*32-1, i.e. it's an unsigned 32 bit integer. Typical uses could be:
|
||||
|
||||
* As return type hint when return values could fall between the maximum `int` value and 2\*\*32-1
|
||||
* For unsigned int arithmetic, in the range 0 to 2\*\*32-1
|
||||
* For pointer arithmetic, see `ptr` data types below
|
||||
|
||||
|
||||
The uint() cast function will return the last 4 bytes of `builtins.int` as a unsigned 32 bit int.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user