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

Small sections about performing math functionality #306

Closed
robamu opened this issue Nov 8, 2021 · 3 comments · Fixed by #308
Closed

Small sections about performing math functionality #306

robamu opened this issue Nov 8, 2021 · 3 comments · Fixed by #308

Comments

@robamu
Copy link
Contributor

robamu commented Nov 8, 2021

Correct me if I am missing any information, but I was not able to use some standard float operations like floor and ceil and I required those when calculating register values for a HAL. Am I missing a necessary import for this? I now added the libm dependency and was able to use the floorf functions for my purposes, but I think not being able to use functions like floor is related to having the #[no_std] attribute on the application?

If that is the case, it might be worth an idea to add a small section related to how to perform some basic math operations which are reserved to std normally

@robamu robamu changed the title Small sections about using math library Small sections about performing math functionality Nov 8, 2021
@eldruin
Copy link
Member

eldruin commented Nov 10, 2021

That is correct. It would be great if you could contribute that small section about this in a PR.

@robamu
Copy link
Contributor Author

robamu commented Nov 10, 2021

Unfortunately, I'm not an expert (yet), I only stumbled upon this when trying to do floating point calculation on a MCU. I could try to get some information about which math operations are allowed and which ones are reserved to std . I might do some research. Maybe someone already compiled a list or something similar? Then I could try to contribute a small section about this topic.

@robamu
Copy link
Contributor Author

robamu commented Nov 11, 2021

A related RFC can be found here: rust-lang/rfcs#2505

bors bot added a commit that referenced this issue Nov 14, 2021
308: added math chapter r=eldruin a=robamu

See #306 . I tried to gather some more information about available crates if more complex functionality is required and added links to them as well.

Co-authored-by: Robin Mueller <robin.mueller.m@gmail.com>
@bors bors bot closed this as completed in #308 Nov 14, 2021
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