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

Add support for micromath #415

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Conversation

Kaikallon
Copy link

Hello,

First off, I'm a beginner in Rust so I don't expect this PR to be accepted without modifications. Feedback is very welcome.

The reson for adding this support is that I wanted to use uom in an embedded environment without support for std. I need support for trigonometric functions, but I still want to keep the power of unit analysis. This is an attempt at doing that.

One concern that I have about my contribution is that I think that there is too much copy pasting. I have played around with this for a while and I wasn't able to find a different way that works.

@Kaikallon
Copy link
Author

I see now that num-traits is an optional feature of micromath. I'm not sure how or if that should be used. Probably because I never understood the purpose of num-traits. Many traits for numeric operations are already defined in the core and standard library.

@Kaikallon
Copy link
Author

Another thing that I noticed is that my implementation could be applied to ratio also. Further, there are more functions which could be implemented, such as sqrt()

@Kaikallon Kaikallon marked this pull request as draft May 20, 2023 20:19
@iliekturtles
Copy link
Owner

Thanks for the PR! Another possible solution for trig functions on no_std is in #309 and uses libm. I'll compare the two (I just need some patience, I'm well behind on PRs) and see what kind of overlap there is.

I also kicked off the tests, but it looks like there is some bitrot and the latest compiler is causing some errors unrelated to your changes.

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 this pull request may close these issues.

2 participants