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

implement std::ops::Neg for Decimal #125

Closed
snd opened this issue May 25, 2018 · 2 comments
Closed

implement std::ops::Neg for Decimal #125

snd opened this issue May 25, 2018 · 2 comments

Comments

@snd
Copy link

snd commented May 25, 2018

the following code fails to compile:

let x = dec!(7314);
let y = -x;

with error:

40 |     let y = -x;
   |             ^^ cannot apply unary operator `-`
   |
   = note: an implementation of `std::ops::Neg` might be missing for `rust_decimal::Decimal`

do you want std::ops::Neg implemented? then i'd do so and open a PR : )

@paupino
Copy link
Owner

paupino commented May 25, 2018

That sounds super useful; thank you!

@snd
Copy link
Author

snd commented May 25, 2018

just started implementation when i found this already exists. though only on master and not the latest version (0.8.1) released on crates. maybe time to release a new version?

@snd snd closed this as completed May 25, 2018
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

2 participants