mirror of
https://github.com/rm-dr/daisy
synced 2025-07-01 14:43:30 -07:00
Fixed minus printing
This commit is contained in:
@ -246,6 +246,20 @@ impl Quantity {
|
||||
Quantity::Rational { .. } => {panic!()}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_negative(&self) -> bool {
|
||||
match self {
|
||||
Quantity::Float { v } => {v.is_sign_negative() && v.is_normal()},
|
||||
Quantity::Rational { v } => {v.is_negative()}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_positive(&self) -> bool {
|
||||
match self {
|
||||
Quantity::Float { v } => {v.is_sign_positive() && v.is_normal()},
|
||||
Quantity::Rational { v } => {v.is_positive()}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Neg for Quantity where {
|
||||
|
Reference in New Issue
Block a user