This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: gcc produces a wrong executable code
- To: Alexandre Oliva <aoliva at redhat dot com>
- Subject: Re: gcc produces a wrong executable code
- From: vakopian <vakopian at usc dot edu>
- Date: Mon, 16 Oct 2000 22:03:55 -0700 (PDT)
- cc: gcc-bugs at gcc dot gnu dot org
I don't exactly agree. The rounding error should have been the same in
both ways of calculations. The difference is at 15th digit after the
point, which for 'double' is not too much.
Also with -O option gcc produces a correct code. So it's not about
rounding errors.
What do you think?
On 17 Oct 2000, Alexandre Oliva wrote:
> On Oct 16, 2000, Vardan Akopian <vakopian@usc.edu> wrote:
>
> > The results should be the same but are different.
>
> Nope. You must take rounding and the possibility of excess precision
> into account when dealing with floating point numbers. GCC is
> right.
>
> --
> Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
> Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
> CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
> Free Software Evangelist *Please* write to mailing lists, not to me
>