Fixed legit gripe from c.l.py that math.fmod docs aren't confusing enough.
authorTim Peters <tim.peters@gmail.com>
Sat, 16 Sep 2000 03:54:24 +0000 (03:54 +0000)
committerTim Peters <tim.peters@gmail.com>
Sat, 16 Sep 2000 03:54:24 +0000 (03:54 +0000)
FRED, please check my monkey-see-monkey-do Tex fiddling!

Doc/lib/libmath.tex
Modules/mathmodule.c
Objects/floatobject.c

index 598431bdf733115c51e13819cbb19085efae0b2b..6edf502629153ac6b6969d8f601fa46cdd0efbc4 100644 (file)
@@ -60,7 +60,9 @@ Return the floor of \var{x} as a real.
 \end{funcdesc}
 
 \begin{funcdesc}{fmod}{x, y}
-Return \code{\var{x} \%\ \var{y}}.
+Return \code{fmod(\var{x}, \var{y})}, as defined by the platform C library.
+Note that the Python expression \code{\var{x} \%\ \var{y}} may not return
+the same result.
 \end{funcdesc}
 
 \begin{funcdesc}{frexp}{x}
index fcd88ad331c0a4d1b43ee4b032f4c2d4e485ee0a..c313f35a22ccc5cd15a4007b0e0208bf894e97bd 100644 (file)
@@ -106,7 +106,8 @@ FUNC1(fabs, fabs,
 FUNC1(floor, floor,
       "floor(x)\n\nReturn the floor of x as a real.")
      FUNC2(fmod, fmod,
-      "fmod(x,y)\n\nReturn x % y.")
+      "fmod(x,y)\n\nReturn fmod(x, y), according to platform C."
+      "  x % y may differ.")
 FUNC2(hypot, hypot,
       "hypot(x,y)\n\nReturn the Euclidean distance, sqrt(x*x + y*y).")
 FUNC1(log, log,
index 946e3d99d3b83d78d5cdd640f5ffd0842829e974..774996f35787c55d3e8b1b252aa1078507a1f178 100644 (file)
@@ -399,7 +399,7 @@ float_divmod(PyFloatObject *v, PyFloatObject *w)
        PyFPE_START_PROTECT("divmod", return 0)
        vx = v->ob_fval;
        mod = fmod(vx, wx);
-       /* fmod is typically exact, so vx-mod is *mathemtically* an
+       /* fmod is typically exact, so vx-mod is *mathematically* an
           exact multiple of wx.  But this is fp arithmetic, and fp
           vx - mod is an approximation; the result is that div may
           not be an exact integral value after the division, although