Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Fix a bug in abs_diff #366

Merged
merged 1 commit into from
Dec 22, 2024
Merged
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/math/support/int_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ macro_rules! int_impl {
}

fn abs_diff(self, other: Self) -> Self {
if self < other { other.wrapping_sub(self) } else { self.wrapping_sub(other) }
self.abs_diff(other)
}

int_impl_common!($uty);
Expand Down Expand Up @@ -221,7 +221,7 @@ macro_rules! int_impl {
}

fn abs_diff(self, other: Self) -> $uty {
self.wrapping_sub(other).wrapping_abs() as $uty
self.abs_diff(other)
}

int_impl_common!($ity);
Expand Down
Loading