Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
True or False
Message
From
16/01/2007 10:38:54
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Environment versions
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01185857
Message ID:
01185904
Views:
13
>>>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?

The precedence of AND means that AND is evaluated first (like multiplication) and then the OR (like addition). So your expressions basically read as
? .f. or .t. or (.f. and .f.) or .f.
? .f. or .f. or (.t. and .f.) or .f.
The precedence of conjunction over disjunction makes parentheses unnecessary, hence they need not be written. It always behaves as if they are.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform