is_complex(), is_real(), and is_rational() are true if the lower type check is true

This commit is contained in:
Eryn Wells 2017-04-10 10:35:17 -07:00
parent 7965f4e971
commit 3571fd02c5

View file

@ -23,11 +23,11 @@ pub trait IsNumber {
/// Should return `true` if this Value is a number type.
fn is_number(&self) -> bool { self.is_complex() || self.is_real() || self.is_rational() || self.is_integer() }
/// Should return `true` if this Value is a complex number type.
fn is_complex(&self) -> bool { false }
fn is_complex(&self) -> bool { self.is_real() }
/// Should return `true` if this Value is a real number type.
fn is_real(&self) -> bool { false }
fn is_real(&self) -> bool { self.is_rational() }
/// Should return `true` if this Value is a rational number type.
fn is_rational(&self) -> bool { false }
fn is_rational(&self) -> bool { self.is_integer() }
/// Should return `true` if this Value is a integer number type.
fn is_integer(&self) -> bool { false }
}