From 634bea801052f463610137c6d534787b864db970 Mon Sep 17 00:00:00 2001 From: Asger Hautop Drewsen Date: Thu, 22 May 2025 09:11:32 +0200 Subject: [PATCH] Implement LowerBounded for BigUint Fixes #329 --- src/biguint.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/biguint.rs b/src/biguint.rs index 196fa323..463b3062 100644 --- a/src/biguint.rs +++ b/src/biguint.rs @@ -11,7 +11,7 @@ use core::mem; use core::str; use num_integer::{Integer, Roots}; -use num_traits::{ConstZero, Num, One, Pow, ToPrimitive, Unsigned, Zero}; +use num_traits::{bounds::LowerBounded, ConstZero, Num, One, Pow, ToPrimitive, Unsigned, Zero}; mod addition; mod division; @@ -161,6 +161,12 @@ impl ConstZero for BigUint { const ZERO: Self = Self::ZERO; // BigUint { data: Vec::new() }; } +impl LowerBounded for BigUint { + fn min_value() -> Self { + Self::ZERO + } +} + impl One for BigUint { #[inline] fn one() -> BigUint {