Explorar o código

Fix normalization in scalar addition

Sam Cappleman-Lynes %!s(int64=7) %!d(string=hai) anos
pai
achega
fd87d87db3
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      bigint/src/biguint.rs

+ 1 - 1
bigint/src/biguint.rs

@@ -402,7 +402,7 @@ impl Add<BigDigit> for BigUint {
 
     #[inline]
     fn add(mut self, other: BigDigit) -> BigUint {
-        if self.data.len() == 0 {
+        if self.data.len() == 0 && other != 0 {
             self.data.push(0);
         }