Another way to write the ternary operator

I’m used to writing the ternary operator like this:

rightLeft = (direction.x < 0.0f) ? -1.f : 1.f;

Thought I’d throw it out there in case others like this way too.

1 Like

Privacy & Terms