diff Doc/lib/libmath.tex @ 32812:d5c97d69dfc7 legacy-trunk

Explain that most floats are actually integers. This is a common confusion for people using floor(), ceil() and modf().
author Tim Peters <tim.peters@gmail.com>
date Mon, 26 Jul 2004 05:12:01 +0000
parents 6e79dea85189
children
line wrap: on
line diff
--- a/Doc/lib/libmath.tex	Mon Jul 26 04:58:50 2004 +0000
+++ b/Doc/lib/libmath.tex	Mon Jul 26 05:12:01 2004 +0000
@@ -79,6 +79,14 @@
 second return value through an `output parameter' (there is no such
 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:
 
 \begin{funcdesc}{exp}{x}