Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Math Formula
Message
De
15/12/2008 08:32:58
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turquie
 
 
À
15/12/2008 06:23:06
Information générale
Forum:
Politics
Catégorie:
Autre
Titre:
Divers
Thread ID:
01366554
Message ID:
01367389
Vues:
7
>>>
>>>-24/4(-2)
>>>
>>>Is it:
>>>
>>>-6(-2) = 12
>>>
>>>Or is it:
>>>
>>>-24/-8 = 3
>>>
>>
>>From the help file:
>>
>>
>>Numeric operators function with all numeric values. The following table lists the numeric operators in order of precedence.
>>
>>Numeric Operators
>>Operator  Action  Code  
>>( )
>> Group subexpressions
>> (4-3) * (12/nVar2)
>> 
>>**, ^
>> Exponentiation
>> ? 3 ** 2
>>
>>? 3 ^ 2
>> 
>>*, /
>> Multiplication and division
>> ? 2 * 7
>>
>>? 14 / 7
>> 
>>%
>> Modulus (remainder)
>> ? 15 % 4
>> 
>>+, -
>> Addition and subtraction
>> ? 4 + 15
>> 
>>
>
>Mike,
>
>The help file does not talk about associativity
>
>Associativity tells you in what order you evaluate operators with equal precedence
>
>Most of them are Left associative, ie
>
>-24 / 4 * (-2)
>(-24 / 4) * (-2)
>
>-24 * 2 / 3
>(-24 * 2 ) / 3
>
>
>In fortran the exponent operator is right associative
>
>2 ^ 3 ^ 2 = 2 ^ (3^2) = 2 ^ 9
>
>
>
>In C#, assignment operators, unary operators and the conditional operator are Right associative
>(I have posted this before http://msdn.microsoft.com/en-us/library/aa691323(VS.71).aspx )
>
>int x = 0;
>int y = -~x ;// 1
>int z = ~-x; // -1
>
exponent has priority in all computer languages and all computer languages are based on left-to-right. They teached us that at university (I graduaded computer programming not an another division )...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform