Skip to content

no method named "fract" found for type "f64" in the current scope when in no_std #133579

Closed as duplicate of#50145
@hukasu

Description

@hukasu

I tried this code:

#![no_std]

fn get_fract(f: f64) -> f64 {
    f.fract()
}

I expected to see this happen: Compiles successfully

Instead, this happened: Fails to compile with E0599 "no method named fract found for type f64 in the current scope"

Meta

rustc --version --verbose:

rustc 1.83.0 (90b35a623 2024-11-26)
binary: rustc
commit-hash: 90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf
commit-date: 2024-11-26
host: x86_64-unknown-linux-gnu
release: 1.83.0
LLVM version: 19.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-discussionCategory: Discussion or questions that doesn't represent real issues.T-libsRelevant to the library team, which will review and decide on the PR/issue.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

    Issue actions