ソースを参照

Fix normalization in scalar addition

Sam Cappleman-Lynes 7 年 前
コミット
fd87d87db3
1 ファイル変更1 行追加1 行削除
  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);
         }