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

Deprecate Float::abs_sub #365

Open
frewsxcv opened this issue May 11, 2018 · 2 comments
Open

Deprecate Float::abs_sub #365

frewsxcv opened this issue May 11, 2018 · 2 comments

Comments

@frewsxcv
Copy link
Contributor

{f32,f64}::abs_sub is misleading and has been deprecated for a couple years. Maybe it should be deprecated in the Float trait too?

@cuviper
Copy link
Member

cuviper commented May 12, 2018

In num-traits we have this in Float, Real, Signed, plus the free function num_traits::sign::abs_sub.

I'm ambivalent. It is surely a weird function, but it's also harmless to leave it alone. It would be more meaningful to wholly remove it (as a breaking change), so trait implementors don't need to bother with it, but deprecation doesn't affect this.

@CAD97
Copy link
Contributor

CAD97 commented May 14, 2018

You could provide a default implementation equivalent to (lhs - rhs).max(Zero::zero()) to allow implementors to pretend it doesn't exist.

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

No branches or pull requests

3 participants