}</pre><divclass='docblock'><p>Useful functions for signed numbers (i.e. numbers that can be negative).</p>
</div>
<h2id='required-methods'>Required Methods</h2>
<divclass='methods'>
<h3id='tymethod.abs'class='method'><spanid='abs.v'class='invisible'><code>fn <ahref='#tymethod.abs'class='fnname'>abs</a>(&self) -> Self</code></span></h3><divclass='docblock'><p>Computes the absolute value.</p>
<p>For <code>f32</code> and <code>f64</code>, <code>NaN</code> will be returned if the number is <code>NaN</code>.</p>
<p>For signed integers, <code>::MIN</code> will be returned if the number is <code>::MIN</code>.</p>
</div><h3id='tymethod.abs_sub'class='method'><spanid='abs_sub.v'class='invisible'><code>fn <ahref='#tymethod.abs_sub'class='fnname'>abs_sub</a>(&self, other: &Self) -> Self</code></span></h3><divclass='docblock'><p>The positive difference of two numbers.</p>
<p>Returns <code>zero</code> if the number is less than or equal to <code>other</code>, otherwise the difference
between <code>self</code> and <code>other</code> is returned.</p>
</div><h3id='tymethod.signum'class='method'><spanid='signum.v'class='invisible'><code>fn <ahref='#tymethod.signum'class='fnname'>signum</a>(&self) -> Self</code></span></h3><divclass='docblock'><p>Returns the sign of the number.</p>
<p>For <code>f32</code> and <code>f64</code>:</p>
<ul>
<li><code>1.0</code> if the number is positive, <code>+0.0</code> or <code>INFINITY</code></li>
<li><code>-1.0</code> if the number is negative, <code>-0.0</code> or <code>NEG_INFINITY</code></li>
<li><code>NaN</code> if the number is <code>NaN</code></li>
</ul>
<p>For signed integers:</p>
<ul>
<li><code>0</code> if the number is zero</li>
<li><code>1</code> if the number is positive</li>
<li><code>-1</code> if the number is negative</li>
</ul>
</div><h3id='tymethod.is_positive'class='method'><spanid='is_positive.v'class='invisible'><code>fn <ahref='#tymethod.is_positive'class='fnname'>is_positive</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span></h3><divclass='docblock'><p>Returns true if the number is positive and false if the number is zero or negative.</p>
</div><h3id='tymethod.is_negative'class='method'><spanid='is_negative.v'class='invisible'><code>fn <ahref='#tymethod.is_negative'class='fnname'>is_negative</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span></h3><divclass='docblock'><p>Returns true if the number is negative and false if the number is zero or positive.</p>