Branchless Programming: Difference between revisions

Line 55: Line 55:
you can do
you can do
<syntaxhighlight lang="python">
<syntaxhighlight lang="python">
y = 2 * (age > 10) - 1
x = x + (20 * (age > 10) - 10)
x = x + 10 * y
# or
# or
y = age > 10
y = age > 10