Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/int/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ impl<const LIMBS: usize> Int<LIMBS> {

// Step 2. determine whether overflow happened.
// Note:
// - overflow can only happen when the inputs have the same sign, and then
// - overflow occurs if and only if the result has the opposite sign of both inputs.
// - overflow can only happen when the inputs have the same sign, and
// - overflow occurs if and only if the result has the opposite sign from both inputs.
//
// We can thus express the overflow flag as: (self.msb == rhs.msb) & (self.msb != res.msb)
let self_msb = self.is_negative();
Expand Down
2 changes: 1 addition & 1 deletion src/int/sign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use num_traits::ConstZero;

impl<const LIMBS: usize> Int<LIMBS> {
/// Returns the word of most significant [`Limb`].
/// For the generative case where the number of limbs is zero,
/// For the degenerate case where the number of limbs is zero,
/// zeroed word is returned (which is semantically correct).
/// This method leaks the limb length of the value, which is also OK.
const fn most_significant_word(&self) -> Word {
Expand Down
2 changes: 1 addition & 1 deletion src/int/sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ impl<const LIMBS: usize> Int<LIMBS> {

// Step 2. check whether underflow happened.
// Note:
// - underflow can only happen when the inputs have opposing signs, and then
// - underflow can only happen when the inputs have opposing signs, and
// - underflow occurs if and only if the result and the lhs have opposing signs.
//
// We can thus express the overflow flag as: (self.msb != rhs.msb) & (self.msb != res.msb)
Expand Down