Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
True or False
Message
De
16/01/2007 10:10:48
 
 
À
16/01/2007 10:05:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Versions des environnements
Database:
Visual FoxPro
Divers
Thread ID:
01185857
Message ID:
01185889
Vues:
19
>>>>So, what are your predictions?
>>>>
>>>>
? .f. or .t. or .f. and .f. or .f.
>>>>? .f. or .f. or .t. and .f. or .f.
>>>
>>>True and False
>>
>>We reasoned from left to right.
>>
>>Our initial reasoning for the 1st one was:
>>step 1) false or true = true
>>step 2) true or false = true
>>step 3) true and false = false
>>step 4) false or false = FALSE
>>
>>Our initial reasoning for the 2nd one was:
>>step 1) false or false = false
>>step 2) false or true = true
>>step 3) true and false = false
>>step 4) false or false = FALSE
>>
>>We now know we were wrong and why. But does anybody here (except Sergey, who obviously appears to know why) know why?
>
>Help ?
>
>
>Logical Operators
>
>
>Logical operators work with all data types and return a Logical value.
>The following table lists the logical operators in order of precedence.
>
>Logical Operators
>
>Operator Action Code
>( )     Expression groups
>NOT, !  Logical negative
>
>AND     Logical AND
>OR      Logical inclusive OR
>
>
>
>
>
>        #define _FALSE_	0
>	#define _TRUE_	1
>	#define or		+
>	#define and		*
>	
>	
>	? _FALSE_ or _TRUE_ or _FALSE_ and _FALSE_ or _FALSE_
>	? _FALSE_ or _FALSE_ or _TRUE_ and _FALSE_ or _FALSE_
>
>	
>	#undefine _FALSE_
>	#undefine _TRUE_	
>	#undefine or
>	#undefine and
>
That's indeed a nice way of demonstrating the logic of precendence.
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform