[Ecls-list] Fwd: Re: Re: latest cvs update fails on cygwin

Brad Beveridge brad.beveridge at gmail.com
Sun Oct 22 19:37:38 UTC 2006


On 22/10/06, Juan Jose Garcia-Ripoll <jjgarcia at users.sourceforge.net> wrote:
> 2006/10/22, Larry Clapp <larry at theclapp.org>:
> >   static double
> >   round_double(double d)
> >   {
> >           if (d > 0) {
> >                   double q = floor(q + 0.5);
>
> Ooops. Stupid typo. Funny that on four platforms it gave the right result :-/
I imagine that you might have gotten lucky with the optimiser.  I'm
guessing that "d" is passed in a register, and that register is
accidentally preserved right through until the call to floor, the call
to floor is possible inlined.

If you made a call to another function before floor, then you would
probably get broken results.

Cheers
Brad




More information about the ecl-devel mailing list