Myke Predko wrote: > Quick question for the Math Wizzes out there. Sorry, pass! > Is there a series method of doing a divide by a constant? I'm > thinking of the divide by three operation: > n/3 = x/2 - x/4 + x/8 - x/16 + x/32 - x/64... From the last thread on this subject, you mean? > which is very easy to code and is very fast. OK, so what's the problem then? This approach is better described as the "multiply by 1/3" operation, and it absolutely general. IOW, for each division, you determine the recurring binary expansion of the fraction, and code that. > Of course, powers of two work the same way. You mean, they only have one term. > Is there a general case for non-powers of two? Yep. But it eludes me right at the moment. I have to go on a 400 km and return trip today. > I got asked for a routine which needs a divide by seven and wondered > if there was a better way of doing it instead of the methods which use > a variable. What methods are they? Do you mean better than the above method? I don't think so, it is pretty accurate. What was determined on the last round is that you have to be *very* careful not to lose precision during the summing operation. -- Cheers, Paul B.