"sign" function in Swift
<p>Is there a function that returns +1 for positive numbers and -1 for negatives in Swift?</p>

<p>I looked through the <em>enormous</em> file that appears if you right-click->definitions on a typical function, but if it's in there I don't know it's name.</p>

<p>I did this:</p>

<pre><code>(num &lt; 0 ? -1 : 1)
</code></pre>

<p>But I'd rather use a built-in function if there is any--for self-documenting reasons at the minimum.</p>