This commit is contained in:
Clar Roʒe 2018-03-14 00:09:57 +00:00 committed by GitHub
commit 2114fdfdc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -23,6 +23,12 @@ pub trait Zero: Sized + Add<Self, Output = Self> {
/// Returns `true` if `self` is equal to the additive identity.
#[inline]
fn is_zero(&self) -> bool;
/// Returns `true` if `self` is not equal to the additive identity.
#[inline]
fn is_nonzero(&self) -> bool {
!self.is_zero()
}
}
macro_rules! zero_impl {