Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A simplier math formula
Message
De
15/12/2008 17:38:39
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turquie
 
 
À
15/12/2008 11:59:20
Information générale
Forum:
Politics
Catégorie:
Autre
Divers
Thread ID:
01367448
Message ID:
01367643
Vues:
7
>>>(1) math will be -4
>>>
>>>(2) Computers will give 4 since the minus sign will be interpreted as a unary operator with higher precedence than the exponent operator
>>
>>
>>http://mathforum.org/library/drmath/view/69058.html
>>
>>According to that page Excel will gives 4 but lotus 1-2-3 gives -4...
>
>Metin,
>
>It's all down to the language's implementation
>
>Most - if not all - languages will interprete the leading minus sign as a unary operator
>
>? -2 ^ 2 && 4
>? 0 - 2^2 && -4
>
>In the second expression, the minus sign is interpreted as a binary operator and is evaluated AFTER the exponent
>
>ps: in one of my old books I find an algorithm to find out when a minus sign is to be treated as unary
>Answer:
>A minus sign is unary if (1) at the beginning of an expression, or (2) right after a left parenthesis

This is a math rule and I think so all computer languages should obey that rule.

Microsoft accept that a mistake and gave a workaround for that:
http://support.microsoft.com/kb/q132686/
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform