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 num traits for d128 #21

Open
eugene-bulkin opened this issue Sep 16, 2016 · 3 comments
Open

Implement num traits for d128 #21

eugene-bulkin opened this issue Sep 16, 2016 · 3 comments

Comments

@eugene-bulkin
Copy link

Would it be possible to implement the Float, Zero and One traits from the num crate? I know some other libraries (e.g. nalgebra) use these as trait requirements for doing calculations, so implementing them for d128 means we can use the struct in other crates that require such traits.

Namely, this requires implementing all the trig functions and some extra math ones. I can see integer_decode and classify being tough to implement, though.

@alkis
Copy link
Owner

alkis commented Sep 26, 2016

It would but it seems like a lot of work. Is there a use case for it? Maybe you want to provide a PR?

@eugene-bulkin
Copy link
Author

The main use case is usability with other crates, e.g. nalgebra. That crate implements matrices that work over anything that implements Float, Zero and One. Since it would be useful to do linear algebra on high-precision decimals, it would be nice.

As for providing a PR, I did plan on looking into it at least a little bit, to see how far I could get before I wasn't able to implement anything on my own. I think I'd mostly just be concerned with the trigonometric functions. I'll try something out in the near future.

@alkis
Copy link
Owner

alkis commented Sep 27, 2016

Thanks Eugene!

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