Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
brod100268yI don't get it..
(0 === 0 || 0 === 1)
//true
even if it was..
(zero = 0 || zero = 1)
//zero=0
Unless your just saying "or" and don't mean it in the sense of an operator.. but still.. -
Non devs will say zero is equal to zero.
Devs will also say zero is equal to zero.
Why should anyone say zero is equal to 1?
Look at my name. I must know that ;-) -
@DivByZero I didn't think it was that difficult, but apparently I was wrong...
0 is false, 1 is true, assuming C notatation
0==0 or 0==1
is just
1 or 0
Which is 1
So the answer is 1, or true -
@azous my reply to DivByZero explains it, if you don't get it...
Maybe not as good of a joke as I thought though 😢 -
I don't get it. Even a non-coder knows nothing isn't the same as one of something.
-
@SecondThread I got that (true) or (false) = true. But why should a non dev think that (true) or (false) = false? That logic is the same for devs and non devs.
-
hell169548y@SecondThread I imagined it the first time, but on some languages true can only be true 😛
-
alkuzad14808yOh man so much assumptions, about operators and integer to boolean binding. For example python has opposite logic. Also some language ad Ruby has two or operators ( literal "or" and "||")
-
This only has to do with logic. It's not a matter of being a dev or not, it's a matter of correct logical reasoning.
P = zero is equal to zero
Q = zero is equal to one
Thus, the logical fornula would be P or Q. So the proposition is indeed true as one of the operands is true.
Related Rants
You can always tell if someone is a programmer by asking them:
Is zero equal to zero or equal to 1?
Non devs say 0, devs say 1
undefined
boolean logic
programmers
non-devs