Branchless Programming: Difference between revisions
| Line 55: | Line 55: | ||
you can do | you can do | ||
<syntaxhighlight lang="python"> | <syntaxhighlight lang="python"> | ||
x = x + (20 * (age > 10) - 10) | |||
# or | # or | ||
y = age > 10 | y = age > 10 | ||
| Line 55: | Line 55: | ||
you can do | you can do | ||
<syntaxhighlight lang="python"> | <syntaxhighlight lang="python"> | ||
x = x + (20 * (age > 10) - 10) | |||
# or | # or | ||
y = age > 10 | y = age > 10 | ||