>>Metin,
>>
>>This is not algebra
>>
>>The minus sign in the first expression is a binary operator.
>>In the second expression, it's a unary operator
>>
>>The unary minus has higher precedence than the exponent
>>The binary minus has lower precedence than the exponent
>>
>>No bug
>
>you say
>
>?5-2^2
>
>different than
>
>?-2^2+5
>
>that can't acceptable...
Why not? As long as the language adheres to the rules it defines, it's not a bug. In the APL programming language everything is evaluated right-to-left except the order can be modified by parens.
So the last expression is -128 -(2 ^ ( 2 + 5))
It's not a bug, it's part of the design.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement