]> granicus.if.org Git - python/commitdiff
Add usage note.
authorRaymond Hettinger <python@rcn.com>
Wed, 17 Jun 2009 01:43:47 +0000 (01:43 +0000)
committerRaymond Hettinger <python@rcn.com>
Wed, 17 Jun 2009 01:43:47 +0000 (01:43 +0000)
Doc/library/itertools.rst

index 918918cc949f314e02eccc509ab1d05b747ad538..eb6306ff2c4c913eb4bb6485767be35fe183e218 100644 (file)
@@ -245,6 +245,10 @@ loops that truncate the stream.
               yield n
               n += step
 
+   When counting with floating point numbers, better accuracy can sometimes be
+   achieved by substituting multiplicative code such as: ``(start + step * i
+   for i in count())``.
+
    .. versionchanged:: 2.7
       added *step* argument and allowed non-integer arguments.