[Python-checkins] python/dist/src/Doc/lib libmath.tex,1.33,1.34

tim_one at users.sourceforge.net tim_one at users.sourceforge.net
Mon Jul 26 07:12:03 CEST 2004


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30093/Doc/lib

Modified Files:
	libmath.tex 
Log Message:
Explain that most floats are actually integers.  This is a common confusion
for people using floor(), ceil() and modf().


Index: libmath.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmath.tex,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** libmath.tex	26 Jul 2004 04:58:50 -0000	1.33
--- libmath.tex	26 Jul 2004 05:12:01 -0000	1.34
***************
*** 80,83 ****
--- 80,91 ----
  thing in Python).
  
+ For the \function{ceil()}, \function{floor()}, and \function{modf()}
+ functions, note that \emph{all} floating-point numbers of sufficiently
+ large magnitude are exact integers.  Python floats typically carry no more
+ than 53 bits of precision (the same as the platform C double type), in
+ which case any float \var{x} with \code{abs(\var{x}) >= 2**52}
+ necessarily has no fractional bits.
+ 
+ 
  Power and logarithmic functions:
  



More information about the Python-checkins mailing list