[Python-checkins] CVS: python/dist/src/Doc/lib libstruct.tex,1.27,1.28
Tim Peters
tim_one@users.sourceforge.net
Mon, 11 Jun 2001 18:22:23 -0700
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv15300/python/dist/src/Doc/lib
Modified Files:
libstruct.tex
Log Message:
Added q/Q standard (x-platform 8-byte ints) mode in struct module.
This completes the q/Q project.
longobject.c _PyLong_AsByteArray: The original code had a gross bug:
the most-significant Python digit doesn't necessarily have SHIFT
significant bits, and you really need to count how many copies of the sign
bit it has else spurious overflow errors result.
test_struct.py: This now does exhaustive std q/Q testing at, and on both
sides of, all relevant power-of-2 boundaries, both positive and negative.
NEWS: Added brief dict news while I was at it.
Index: libstruct.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstruct.tex,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -r1.27 -r1.28
*** libstruct.tex 2001/06/10 23:40:19 1.27
--- libstruct.tex 2001/06/12 01:22:21 1.28
***************
*** 73,77 ****
The \character{q} and \character{Q} conversion codes are available in
native mode only if the platform C compiler supports C \ctype{long long},
! or, on Windows, \ctype{__int64}.
\end{description}
--- 73,78 ----
The \character{q} and \character{Q} conversion codes are available in
native mode only if the platform C compiler supports C \ctype{long long},
! or, on Windows, \ctype{__int64}. They're always available in standard
! modes.
\end{description}
***************
*** 101,106 ****
that exactly enough bytes are used to satisfy the count.
! For the \character{I} and \character{L} format characters, the return
! value is a Python long integer.
For the \character{P} format character, the return value is a Python
--- 102,107 ----
that exactly enough bytes are used to satisfy the count.
! For the \character{I}, \character{L}, \character{q} and \character{Q}
! format characters, the return value is a Python long integer.
For the \character{P} format character, the return value is a Python
***************
*** 140,147 ****
Standard size and alignment are as follows: no alignment is required
! for any type (so you have to use pad bytes); \ctype{short} is 2 bytes;
! \ctype{int} and \ctype{long} are 4 bytes. \ctype{float} and
! \ctype{double} are 32-bit and 64-bit IEEE floating point numbers,
! respectively.
Note the difference between \character{@} and \character{=}: both use
--- 141,150 ----
Standard size and alignment are as follows: no alignment is required
! for any type (so you have to use pad bytes);
! \ctype{short} is 2 bytes;
! \ctype{int} and \ctype{long} are 4 bytes;
! \ctype{long long} (\ctype{__int64} on Windows) is 8 bytes;
! \ctype{float} and \ctype{double} are 32-bit and 64-bit
! IEEE floating point numbers, respectively.
Note the difference between \character{@} and \character{=}: both use