Bug GCC
Martin v. Loewis
martin@loewis.home.cs.tu-berlin.de
Thu Feb 10 04:44:00 GMT 2000
> J'ai constaté que dans certaines circonstances (par exemple : a=2,
> b=8, c=1), la division est purement et simplement omise. Pour
> forcer la division, il faut couper l'instruction en deux :
> x1=(-b+sqrt(delta)); x1/=2*a;. Le compilateur ne signale pourtant
> aucune erreur !
Thanks for your bug report. I had problems reproducing your problem -
in the attached file, you had already worked-around the problem,
right?
I assume the original statement was something like
x1 = (-b + racine_delta) / 2.0*a;
Now, in C, both division and multiplication have the same precedence,
and are left-associative, so the above expression is equivalent to
x1 = ((-b + racine_delta) / 2.0)*a;
which is not what you wanted. Since this is a homework, I cannot
provide further help; you'll have to figure out the correction
yourself.
Hope this helps,
Martin
P.S. When you send source code, please attach it as ASCII
file. Extracting it from the PDF is not that easy (if you don't want
to lose the formatting).
P.P.S. Je ne parle pas français, at least not very good. Since this is
an international list, asking questions in English gives a better
guarantee that they are understood correctly - even if you don't speak
English well.
More information about the Gcc-bugs
mailing list