pub trait Signed {
// Required method
fn signum(&self) -> Sign;
// Provided methods
fn is_positive(&self) -> bool { ... }
fn is_negative(&self) -> bool { ... }
}
Expand description
§Signed numbers
A number that is positive, negative or zero.
Required Methods§
Provided Methods§
sourcefn is_positive(&self) -> bool
fn is_positive(&self) -> bool
Whether the number is (strictly) greater than zero.
sourcefn is_negative(&self) -> bool
fn is_negative(&self) -> bool
Whether the number is (strictly) smaller than zero.