Skip to content

Commit

Permalink
fix carrying_add and borrwing_sub
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacholt100 committed Sep 20, 2024
1 parent 7dd9370 commit 1eaa169
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/int/bigint_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ macro_rules! impls {
let (s1, o1) = self.overflowing_add(rhs);
if carry {
let (s2, o2) = s1.overflowing_add(Self::ONE);
(s2, o1 || o2)
(s2, o1 ^ o2)
} else {
(s1, o1)
}
Expand All @@ -20,7 +20,7 @@ macro_rules! impls {
let (s1, o1) = self.overflowing_sub(rhs);
if borrow {
let (s2, o2) = s1.overflowing_sub(Self::ONE);
(s2, o1 || o2)
(s2, o1 ^ o2)
} else {
(s1, o1)
}
Expand Down

0 comments on commit 1eaa169

Please sign in to comment.