Logical Question
From RoboWiki
From User talk:Sheldor
Revision as of 25 June 2013 at 18:59.
The [/w/index.php?title=User_talk:Sheldor&offset=20130625185942&lqt_mustshow=3525 highlighted comment] was created in this revision.
The [/w/index.php?title=User_talk:Sheldor&offset=20130625185942&lqt_mustshow=3525 highlighted comment] was created in this revision.
Is there any kind of bit operation or arithmetical trick that would allow me to do something like integerWhichCouldOnlyHaveAValueOfZeroOrOne == 0 ? otherIntegerWhichCouldOnlyHaveAValueOfZeroOrOne == 0 ? 0 : 1 : 2
without so many expensive conditionals?
Like this?
integerWhichCouldOnlyHaveAValueOfZeroOrOne | otherIntegerWhichCouldOnlyHaveAValueOfZeroOrOne + integerWhichCouldOnlyHaveAValueOfZeroOrOne
If there is no possibility that integerWhichCouldOnlyHaveAValueOfZeroOrOne == 1
and otherIntegerWhichCouldOnlyHaveAValueOfZeroOrOne == 0
, or if you don't care, then a simple addition would work.
Skilgannon (talk)