Lets see what we can do to transform this: for(x=x1;x <= x2;x++) { if((eps << 1) >= DeltaX) { eps -= DeltaX; } } into something more effecient. First if ((eps << 1) >= DeltaX Is (roughly, except for possible rounding issues) equivalent to: if (eps >= DeltaX / 2) But if we subtract DeltaX/2 from X before entering the loop then we have: if (eps >= 0) So now we have: eps -= DeltaX >> 1; for(x=x1;x <= x2;x++) { if(eps >= 0) { eps -= DeltaX; } } Is that a little simpler? Bob Ammerman RAm Systems (contract development of high performance, high function, low-level software) -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics