Skip to content

Commit

Permalink
Fix carrying_neg docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
erik-3milabs committed Oct 29, 2024
1 parent 0067207 commit 7688826
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/int/neg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ impl<const LIMBS: usize> Int<LIMBS> {
/// Perform the two's complement "negate" operation on this [`Int`]:
/// map `self` to `(self ^ 1111...1111) + 0000...0001` and return the carry.
///
/// Note: a zero carry indicates `self == Self::ZERO`.
/// Note: a non-zero carry indicates `self == Self::ZERO`.
///
/// Warning: this operation is unsafe to use as negation; the negation is incorrect when
/// `self == Self::MIN`.
Expand Down
2 changes: 1 addition & 1 deletion src/uint/neg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ impl<const LIMBS: usize> Uint<LIMBS> {
}

/// Perform negation; additionally return the carry.
/// Note: the carry equals `Word::ZERO` when `self == Self::ZERO`, and `Word::MAX` otherwise.
/// Note: the carry equals `Word::MAX` when `self == Self::ZERO`, and `Word::ZERO` otherwise.
pub const fn carrying_neg(&self) -> (Self, Word) {
let mut ret = [Limb::ZERO; LIMBS];
let mut carry = 1;
Expand Down

0 comments on commit 7688826

Please sign in to comment.