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: Bug GCC


> 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.

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