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

index 7baa5e10de65137e3632f93f68fbe045f6098045..ac3b761198c4f1fef9cfae2b533b88a1b460510c 100644 (file)
@@ -235,6 +235,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:: 3.1
       added *step* argument and allowed non-integer arguments.