diff --git a/src/lib.rs b/src/lib.rs index b1cf2a4..956dbac 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -39,6 +39,7 @@ use num_bigint::{BigInt, BigUint, Sign, ToBigInt}; use num_integer::Integer; use num_traits::float::FloatCore; use num_traits::{ + bounds::{LowerBounded, UpperBounded}, Bounded, CheckedAdd, CheckedDiv, CheckedMul, CheckedSub, ConstOne, ConstZero, FromPrimitive, Inv, Num, NumCast, One, Pow, Signed, ToPrimitive, Unsigned, Zero, }; @@ -425,6 +426,18 @@ impl Hash for Ratio { } } +impl LowerBounded for Ratio { + fn min_value() -> Self { + Self::from_integer(T::min_value()) + } +} + +impl UpperBounded for Ratio { + fn max_value() -> Self { + Self::from_integer(T::max_value()) + } +} + mod iter_sum_product { use crate::Ratio; use core::iter::{Product, Sum};