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

libcore and f32::{abs, mod_euc} #54876

Closed
petoknm opened this issue Oct 6, 2018 · 3 comments
Closed

libcore and f32::{abs, mod_euc} #54876

petoknm opened this issue Oct 6, 2018 · 3 comments
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@petoknm
Copy link

petoknm commented Oct 6, 2018

Are there plans for moving stuff like this into the core crate? I am doing embedded stuff and currently I would like to use the brand spanking new mod_euc methods for floats and can't.

error[E0599]: no method named `mod_euc` found for type `f32` in the current scope
  --> src/main.rs:46:23
   |
46 |     let r = (5.0_f32).mod_euc(2.0);
   |                       ^^^^^^^

I found this comment that just points to an ease of first implementation as the reason for this being in the std crate. Are there any other reasons for this? If not, I could try to pull this and some related functionality from std to core crate.

@petoknm
Copy link
Author

petoknm commented Oct 6, 2018

.abs() is also handy to have in no_std environments sometimes

error[E0599]: no method named `abs` found for type `f64` in the current scope
  --> src/main.rs:26:17
   |
26 |         r + rhs.abs()
   |                 ^^^

@petoknm petoknm changed the title libcore and f32::mod_euc libcore and f32::{abs, mod_euc} Oct 6, 2018
@Centril Centril added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. C-feature-request Category: A feature request, i.e: not implemented / a PR. labels Oct 6, 2018
@Centril
Copy link
Contributor

Centril commented Oct 6, 2018

I would suggest writing up a PR; if it can be in libcore I see no reason why it shouldn't.

@petoknm
Copy link
Author

petoknm commented Oct 6, 2018

@petoknm petoknm closed this as completed Oct 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants