]> granicus.if.org Git - python/commitdiff
Added unsigned data formats (B, H, I, L).
authorGuido van Rossum <guido@python.org>
Fri, 3 Jan 1997 19:20:52 +0000 (19:20 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 3 Jan 1997 19:20:52 +0000 (19:20 +0000)
Doc/lib/libarray.tex
Doc/libarray.tex

index 8122f4965bcd63e6ad6ea35b283841c539356230..1b028b339d31d7102769b6753e081642ab089d0f 100644 (file)
@@ -12,16 +12,23 @@ which is a single character.  The following type codes are defined:
 \begin{tableiii}{|c|c|c|}{code}{Typecode}{Type}{Minimal size in bytes}
 \lineiii{'c'}{character}{1}
 \lineiii{'b'}{signed integer}{1}
+\lineiii{'B'}{unsigned integer}{1}
 \lineiii{'h'}{signed integer}{2}
+\lineiii{'H'}{unsigned integer}{2}
 \lineiii{'i'}{signed integer}{2}
+\lineiii{'I'}{unsigned integer}{2}
 \lineiii{'l'}{signed integer}{4}
+\lineiii{'L'}{unsigned integer}{4}
 \lineiii{'f'}{floating point}{4}
 \lineiii{'d'}{floating point}{8}
 \end{tableiii}
 
 The actual representation of values is determined by the machine
 architecture (strictly speaking, by the C implementation).  The actual
-size can be accessed through the \var{itemsize} attribute.
+size can be accessed through the \var{itemsize} attribute.  The values
+stored  for \code{'L'} and \code{'I'} items will be represented as
+Python long integers when retrieved, because Python's plain integer
+type can't represent the full range of C's unsigned (long) integers.
 
 See also built-in module \code{struct}.
 \bimodindex{struct}
index 8122f4965bcd63e6ad6ea35b283841c539356230..1b028b339d31d7102769b6753e081642ab089d0f 100644 (file)
@@ -12,16 +12,23 @@ which is a single character.  The following type codes are defined:
 \begin{tableiii}{|c|c|c|}{code}{Typecode}{Type}{Minimal size in bytes}
 \lineiii{'c'}{character}{1}
 \lineiii{'b'}{signed integer}{1}
+\lineiii{'B'}{unsigned integer}{1}
 \lineiii{'h'}{signed integer}{2}
+\lineiii{'H'}{unsigned integer}{2}
 \lineiii{'i'}{signed integer}{2}
+\lineiii{'I'}{unsigned integer}{2}
 \lineiii{'l'}{signed integer}{4}
+\lineiii{'L'}{unsigned integer}{4}
 \lineiii{'f'}{floating point}{4}
 \lineiii{'d'}{floating point}{8}
 \end{tableiii}
 
 The actual representation of values is determined by the machine
 architecture (strictly speaking, by the C implementation).  The actual
-size can be accessed through the \var{itemsize} attribute.
+size can be accessed through the \var{itemsize} attribute.  The values
+stored  for \code{'L'} and \code{'I'} items will be represented as
+Python long integers when retrieved, because Python's plain integer
+type can't represent the full range of C's unsigned (long) integers.
 
 See also built-in module \code{struct}.
 \bimodindex{struct}