Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: abs_sub does not compute the difference #665

Closed
heyterrance opened this issue Aug 2, 2024 · 1 comment · Fixed by #666
Closed

bug: abs_sub does not compute the difference #665

heyterrance opened this issue Aug 2, 2024 · 1 comment · Fixed by #666

Comments

@heyterrance
Copy link

When self > other, self.abs() is returned instead of self - other

rust-decimal/src/decimal.rs

Lines 1895 to 1901 in 6f8b0ae

fn abs_sub(&self, other: &Self) -> Self {
if self <= other {
ZERO
} else {
self.abs()
}
}

@paupino
Copy link
Owner

paupino commented Aug 2, 2024

This is a good catch - fortunately an easy fix will whip up a quick PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants