5,332
edits
Line 59: | Line 59: | ||
// or | // or | ||
y = age > 10; | y = age > 10; | ||
x = x + 10 * y - 10 * | x = x + 10 * y - 10 * !y; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 68: | Line 68: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
you can just write <code>x += age>10</code>. | you can just write <code>x += age>10;</code>. | ||
These are micro optimizations but they could be useful for speeding up GPU shaders in some cases. | These are micro optimizations but they could be useful for speeding up GPU shaders in some cases. |