2011/9/24 Chris Angelico <ros...@gmail.com>: > On Sat, Sep 24, 2011 at 11:53 PM, Steven D'Aprano > <steve+comp.lang.pyt...@pearwood.info> wrote: >> #1 add multiples of the width to the starting value, 0. >> >> #2 subtract multiples of width from the ending value, 2.1. > > #3, go half and half - generate the lower half by adding to the lower > bound, and the upper half by subtracting from the upper bound. Not > sure if it'll help or not but it might be worth a shot. > > ChrisA > -- Just a naive way: #4 compute the values in both directions and use the average of the results (of, course, given, there isn't a better way to distinguish the values showing rounding errors automatically).
(I guess dealing manually with values obtained by .as_integer_ratio() doesn't count as pure float operation...) vbr -- http://mail.python.org/mailman/listinfo/python-list