If you need min/max in order to avoid an expensive branch, you shouldn't use the ternary operator, as it will compile down to a jump. The link below describes a useful method for implementing a min/max function without branching.
http://graphics.stanford.edu/~seander/bithacks.html#IntegerMinOrMax