This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Bug GCC
- To: r dot viseur at usa dot net
- Subject: Re: Bug GCC
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Thu, 10 Feb 2000 13:37:44 +0100
- CC: bug-gcc at gnu dot org
- References: <20000210111408.19400.qmail@www0q.netaddress.usa.net>
> 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.