Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b0b8181

Browse files
committed
Added unsigned data formats (B, H, I, L).
1 parent 7a61f87 commit b0b8181

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

Doc/lib/libarray.tex

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,23 @@ \section{Built-in Module \sectcode{array}}
1212
\begin{tableiii}{|c|c|c|}{code}{Typecode}{Type}{Minimal size in bytes}
1313
\lineiii{'c'}{character}{1}
1414
\lineiii{'b'}{signed integer}{1}
15+
\lineiii{'B'}{unsigned integer}{1}
1516
\lineiii{'h'}{signed integer}{2}
17+
\lineiii{'H'}{unsigned integer}{2}
1618
\lineiii{'i'}{signed integer}{2}
19+
\lineiii{'I'}{unsigned integer}{2}
1720
\lineiii{'l'}{signed integer}{4}
21+
\lineiii{'L'}{unsigned integer}{4}
1822
\lineiii{'f'}{floating point}{4}
1923
\lineiii{'d'}{floating point}{8}
2024
\end{tableiii}
2125

2226
The actual representation of values is determined by the machine
2327
architecture (strictly speaking, by the C implementation). The actual
24-
size can be accessed through the \var{itemsize} attribute.
28+
size can be accessed through the \var{itemsize} attribute. The values
29+
stored for \code{'L'} and \code{'I'} items will be represented as
30+
Python long integers when retrieved, because Python's plain integer
31+
type can't represent the full range of C's unsigned (long) integers.
2532

2633
See also built-in module \code{struct}.
2734
\bimodindex{struct}

Doc/libarray.tex

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,23 @@ \section{Built-in Module \sectcode{array}}
1212
\begin{tableiii}{|c|c|c|}{code}{Typecode}{Type}{Minimal size in bytes}
1313
\lineiii{'c'}{character}{1}
1414
\lineiii{'b'}{signed integer}{1}
15+
\lineiii{'B'}{unsigned integer}{1}
1516
\lineiii{'h'}{signed integer}{2}
17+
\lineiii{'H'}{unsigned integer}{2}
1618
\lineiii{'i'}{signed integer}{2}
19+
\lineiii{'I'}{unsigned integer}{2}
1720
\lineiii{'l'}{signed integer}{4}
21+
\lineiii{'L'}{unsigned integer}{4}
1822
\lineiii{'f'}{floating point}{4}
1923
\lineiii{'d'}{floating point}{8}
2024
\end{tableiii}
2125

2226
The actual representation of values is determined by the machine
2327
architecture (strictly speaking, by the C implementation). The actual
24-
size can be accessed through the \var{itemsize} attribute.
28+
size can be accessed through the \var{itemsize} attribute. The values
29+
stored for \code{'L'} and \code{'I'} items will be represented as
30+
Python long integers when retrieved, because Python's plain integer
31+
type can't represent the full range of C's unsigned (long) integers.
2532

2633
See also built-in module \code{struct}.
2734
\bimodindex{struct}

0 commit comments

Comments
 (0)