can you simplify this conditional?
if (!((!X || !Y) && X))
Do my job for me
Other urls found in this thread:
en.wikipedia.org
wolframalpha.com
twitter.com
its just like arithmetic, u gotta distribute the !
if(X)
((X || Y) && !X)
>can you simplify this conditional?
>if (!((!X || !Y) && X))
if !((!X || !Y) && X)
Thank me later
Is there a tutorial or something about how to distribute the !
if (kys = 1)
Here is your code
Use the catalog fucklord.
>using the assignment operator
>if (!((!X || !Y) && X))
>if ((X || Y) && !X)
>if (Y && !X)
!x && y
So it'll always return true, ya dingus
> Not even using De Morgan's Law
I know, you are probably shitposting, but come on, you could have done it better
Using De Morgan:
if (!((!X || !Y) && X))
if (!(!X || !Y) || !X)
if ((X && Y) || !X)
Truth table:
X Y R
0 0 1
0 1 1
1 0 0
1 1 1
Conditional from table:
if (!(x && !y))
Result:
if (!x || y)
You don't even need a truth table, just use the the law of distributivity
>it'll always return true
>not knowing assignment op returns rvalue
ishygddt
Ok then:
(X && Y) || !X
Is equivalent to:
(X * Y) + X'
because:
X' = 1 - X
[/code
then:
(X * Y) + (1 - X)
X * Y - X + 1
X * (Y - 1) + 1
-X * (1 - Y) + 1
1 - (X * (1 - Y))
(X * Y')'
Reconverting to boolean algebra:
!(X && !Y)
and using De Morgan:
!X || Y
That's ok 4ya, buddy?
I jost got boner looking at that pic
What exactly does ! Represent in this statement
¬
Got Y && !X as well, correct yes? I'm seeing too many different answers and it's making me question myself
Should be ||, not &&
!((!X || !Y) && X)
!(!X || !Y) || !X
(X && Y) || !X
(X || !X) && (Y || !X)
true && (Y || !X)
Y || !X
DeMorgan's Laws
I got this too. Regardless how you put it, X has to be true. Y can be true or false.
>returns rvalue
Which, in that case, equals to 1 => Statement is always true.
if (!gentoo) do install gentoo
it depends on the language, you turd
Would compilators generate warning for that?
Not to mention it is against any good practice.
Why would I do your job when a computer can?
wolframalpha.com