order of operations

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

order of operations

gcambi
Hello,

when I evaluate the following expression:
12 - (3 - 2)
the result is 7, and to obtain  what  I expected (11) I have to do
something like:
12 + (3 - 2) negated
or
12 - ((3 - 2) * 1).

Am I missing something?
Reply | Threaded
Open this post in threaded view
|

Re: order of operations

Nicolas Petton
gcambi <[hidden email]> writes:

Hi!

This is an inlining bug. The compiler inlines the #- message send... and
does it wrong (missing parens).

Could you add a bug entry to the issue tracker?

Thanks!
Nico

> Hello,
>
> when I evaluate the following expression:
> 12 - (3 - 2)
> the result is 7, and to obtain  what  I expected (11) I have to do
> something like:
> 12 + (3 - 2) negated
> or
> 12 - ((3 - 2) * 1).
>
> Am I missing something?