On Thu, Sep 25, 2014 at 10:40 PM, Dave Angel <da...@davea.name> wrote: > Another approach is to see if twiddling the last digit gets you > from too high to too low. I used this approach to check a trig > package I wrote in '75. An answer was close enough if twiddling > the last digit changed the result value from too high to too low, > or if twiddling the last digit of the argument did. I needed to > go both ways because the curve sometimes had a slope greater than > one.
Ooh, that sounds clean. So, something like this: if x * FACTOR > y: reduce_last_digit_of_x if x * FACTOR > y: error otherwise do the opposite check ? That's pretty doable. ChrisA -- https://mail.python.org/mailman/listinfo/python-list