Clarify possible uses of uint

master
bixb922 2024-05-04 14:36:38 -04:00
rodzic 9b313453b3
commit 0326c75322
1 zmienionych plików z 6 dodań i 1 usunięć

@ -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.