DisplayCoef

Trait DisplayCoef 

Source
pub trait DisplayCoef {
    // Required methods
    fn has_negative_sign(&self) -> bool;
    fn needs_parentheses(&self) -> bool;
}
Expand description

A coefficent that can be displayed in a linear combination.

Required Methods§

Source

fn has_negative_sign(&self) -> bool

Does coefficent have a negative sign?

In contrast to the is_negative method of num_traits::Signed, this is about syntax rather than denotion. For example, the symbolic expression -k has a negative sign, but may or may not denote a negative number, depending on whether k itself takes a positive value.

Source

fn needs_parentheses(&self) -> bool

Does the coefficient need to be parenthesized when displayed?

Implementations on Foreign Types§

Source§

impl DisplayCoef for f32

Source§

impl DisplayCoef for f64

Source§

impl DisplayCoef for i32

Source§

impl DisplayCoef for i64

Source§

impl DisplayCoef for u32

Source§

impl DisplayCoef for u64

Source§

impl DisplayCoef for usize

Implementors§

Source§

impl<Var, Coef, Exp> DisplayCoef for Polynomial<Var, Coef, Exp>
where Var: Ord, Coef: DisplayCoef, Exp: Ord,