Am 15 Oct 2007 um 7:07 hat johan556 / gmail.com geschrieben: > The following line in "flodivmod" in "numeric.c" is currently > expected > to return an exact integer value (in double format): > > div = (x - mod) / y; > > One can not do IEEE floating pointing arithmetic like that and > expect > the result to be *exact*. The result might be almost an integer > value, > like 6.99999999999999911182. So the algorithm in "flodivmod" need to > be changed. > How about simply: static void flodivmod(double x, double y, double *divp, double *modp) { double div, mod; div = floor(x/y); mod = x - div * y; if (modp) *modp = mod; if (divp) *divp = div; }