Enum prolog_parser::ast::Number [−][src]
Variants
Float(OrderedFloat<f64>)
Integer(Rc<BigInt>)
Rational(Rc<Ratio<BigInt>>)
Methods
impl Number
[src]
impl Number
pub fn pow(self, other: Number) -> Result<Self, ArithmeticError>
[src]
pub fn pow(self, other: Number) -> Result<Self, ArithmeticError>
pub fn is_zero(&self) -> bool
[src]
pub fn is_zero(&self) -> bool
pub fn abs(&self) -> Self
[src]
pub fn abs(&self) -> Self
Trait Implementations
impl Clone for Number
[src]
impl Clone for Number
fn clone(&self) -> Number
[src]
fn clone(&self) -> Number
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq for Number
[src]
impl PartialEq for Number
fn eq(&self, other: &Number) -> bool
[src]
fn eq(&self, other: &Number) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Number) -> bool
[src]
fn ne(&self, other: &Number) -> bool
This method tests for !=
.
impl Eq for Number
[src]
impl Eq for Number
impl Hash for Number
[src]
impl Hash for Number
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl PartialOrd for Number
[src]
impl PartialOrd for Number
fn partial_cmp(&self, other: &Number) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Number) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
fn gt(&self, other: &Rhs) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
fn ge(&self, other: &Rhs) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for Number
[src]
impl Ord for Number
fn cmp(&self, other: &Number) -> Ordering
[src]
fn cmp(&self, other: &Number) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl Display for Number
[src]
impl Display for Number
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for Number
[src]
impl Default for Number
impl Add<Number> for Number
[src]
impl Add<Number> for Number
type Output = Number
The resulting type after applying the +
operator.
fn add(self, rhs: Number) -> Self::Output
[src]
fn add(self, rhs: Number) -> Self::Output
Performs the +
operation.
impl Sub<Number> for Number
[src]
impl Sub<Number> for Number
type Output = Number
The resulting type after applying the -
operator.
fn sub(self, rhs: Number) -> Self::Output
[src]
fn sub(self, rhs: Number) -> Self::Output
Performs the -
operation.
impl Mul<Number> for Number
[src]
impl Mul<Number> for Number
type Output = Number
The resulting type after applying the *
operator.
fn mul(self, rhs: Number) -> Self::Output
[src]
fn mul(self, rhs: Number) -> Self::Output
Performs the *
operation.
impl Div<Number> for Number
[src]
impl Div<Number> for Number
type Output = Number
The resulting type after applying the /
operator.
fn div(self, rhs: Number) -> Self::Output
[src]
fn div(self, rhs: Number) -> Self::Output
Performs the /
operation.
impl Neg for Number
[src]
impl Neg for Number