This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcc produces a wrong executable code


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
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]