Skip to content

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

Closed
Closed
@petoknm

Description

@petoknm

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.

Activity

petoknm

petoknm commented on Oct 6, 2018

@petoknm
Author

.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()
   |                 ^^^
changed the title [-]libcore and f32::mod_euc[/-] [+]libcore and f32::{abs, mod_euc}[/+] on Oct 6, 2018
added
T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.
on Oct 6, 2018
Centril

Centril commented on Oct 6, 2018

@Centril
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @Centril@petoknm

        Issue actions

          libcore and f32::{abs, mod_euc} · Issue #54876 · rust-lang/rust