Trait std::num::SignedIntStable
[-] [+]
[src]
pub trait SignedInt: Int + Neg where Self: Int, Self: Neg, <Self as Neg>::Output == Self {
fn abs(self) -> Self;
fn signum(self) -> Self;
fn is_positive(self) -> bool;
fn is_negative(self) -> bool;
}
A built-in two's complement integer.
Required Methods
fn abs(self) -> Self
Computes the absolute value of self
. Int::min_value()
will be
returned if the number is Int::min_value()
.
fn signum(self) -> Self
Returns a number representing sign of self
.
0
if the number is zero1
if the number is positive-1
if the number is negative
fn is_positive(self) -> bool
Returns true
if self
is positive and false
if the number
is zero or negative.
fn is_negative(self) -> bool
Returns true
if self
is negative and false
if the number
is zero or positive.