Skip to content

absent precision parameter for floating point format string is undocumented #131159

@e00E

Description

@e00E
Contributor

I am talking about format strings of the form format!"{:.}", 1.234). The corresponding documentation for the precision argument is here. The documentation writes that the format is .N where N is an integer specifying the precision.

The bug is that it is not documented that N can also be absent. Either this should not be accepted by the compiler or it should be documented.

I believe the intention is that an absent N means the same thing as if there was no precision specified at all (no :.). Note that this is not the same as "as much precision as needed".

Activity

added
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Oct 2, 2024
added
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools
T-libsRelevant to the library team, which will review and decide on the PR/issue.
A-floating-pointArea: Floating point numbers and arithmetic
A-fmtArea: `core::fmt`
and removed
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Oct 2, 2024
linked a pull request that will close this issue on Feb 6, 2025
added a commit that references this issue on Feb 6, 2025

Auto merge of rust-lang#136638 - hkBst:format_parse, r=<try>

77e9660
added a commit that references this issue on Feb 8, 2025
added a commit that references this issue on Feb 8, 2025

103 remaining items

Loading
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

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-floating-pointArea: Floating point numbers and arithmeticA-fmtArea: `core::fmt`C-bugCategory: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @e00E@fmease@hkBst@rustbot

      Issue actions

        absent precision parameter for floating point format string is undocumented · Issue #131159 · rust-lang/rust