x404.co.uk http://www.x404.co.uk/forum/ |
|
Semantics http://www.x404.co.uk/forum/viewtopic.php?f=4&t=13059 |
Page 1 of 1 |
Author: | Fogmeister [ Thu Mar 17, 2011 10:46 am ] |
Post subject: | Semantics |
Just trying to work out what I think a logical/boolean expression should result in. If a, b, c and d are all boolean values/expressions and I had an expression... (a AND b) OR (c AND d) then the expression is true if either a and b are both true or c and d are both true. If I had the expression... a AND (b OR c) AND d then this would be true only if a and d are true and either of b or c (or both) is true. But what if I had the expression... a AND b OR c AND d How would the expression work? Or would it depend on the language being used? Purely a semantics question just out of interest. |
Author: | forquare1 [ Thu Mar 17, 2011 11:16 am ] | |||||||||
Post subject: | Re: Semantics | |||||||||
From the Boolean logic page on Wikipedia:
So, would it be: (a AND b) or (c AND d) The expression is true if both a and b are true, OR if c and d are true. |
Author: | Fogmeister [ Thu Mar 17, 2011 12:05 pm ] | ||||||||||||||||||
Post subject: | Re: Semantics | ||||||||||||||||||
Ah, cool! Thank you! |
Author: | finlay666 [ Thu Mar 17, 2011 1:32 pm ] |
Post subject: | Re: Semantics |
Easiest way is to use parenthesis as there is no penalty on excessive parenthesis usage (as it's stripped out during compilation anyway) and it aids in readability ![]() |
Author: | Fogmeister [ Thu Mar 17, 2011 2:15 pm ] | |||||||||
Post subject: | Re: Semantics | |||||||||
(((That)(')(s)) (my) (usual) (approach)(.)) ![]() But just came across a bit that didn't have any and wondered how it would work. I wrote a bit of code to try some values but just thought I'd ask aswell ![]() |
Author: | John_Vella [ Mon Mar 21, 2011 3:31 pm ] | ||||||||||||||||||
Post subject: | Re: Semantics | ||||||||||||||||||
I agree! (.)(.) <-- For JJ ![]() ![]() </Totally pointless post> |
Author: | Fogmeister [ Mon Mar 21, 2011 3:41 pm ] | |||||||||||||||||||||||||||
Post subject: | Re: Semantics | |||||||||||||||||||||||||||
ROFL! I was wondering who would be the first person to do that ![]() ![]() |
Author: | EddArmitage [ Mon Mar 21, 2011 4:31 pm ] | |||||||||
Post subject: | Re: Semantics | |||||||||
Yoshi peering through a letter box! |
Author: | finlay666 [ Mon Mar 21, 2011 4:44 pm ] | |||||||||
Post subject: | Re: Semantics | |||||||||
I prefer ( , )( , ) <-- tassels/pasties ![]() |
Author: | Fogmeister [ Mon Mar 21, 2011 10:52 pm ] |
Post subject: | Re: Semantics |
Was trying to think of another one and discovered this version of Yoshi peering through a letter box... ( .Y. ) ![]() |
Author: | EddArmitage [ Mon Mar 21, 2011 11:03 pm ] | |||||||||
Post subject: | Re: Semantics | |||||||||
Yeah. Me and Nick (Miners) have found quite a number. He's got a dirtier mind than me, though. |
Author: | John_Vella [ Wed Mar 23, 2011 3:18 pm ] | ||||||||||||||||||
Post subject: | Re: Semantics | ||||||||||||||||||
Leaking...? ![]() ![]() |
Author: | finlay666 [ Wed Mar 23, 2011 3:21 pm ] | ||||||||||||||||||
Post subject: | Re: Semantics | ||||||||||||||||||
That would be
|
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |