-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
absent precision parameter for floating point format string is undocumented #131159
Copy link
Copy link
Open
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-floating-pointArea: Floating point numbers and arithmeticArea: Floating point numbers and arithmeticA-fmtArea: `core::fmt`Area: `core::fmt`C-bugCategory: This is a bug.Category: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-floating-pointArea: Floating point numbers and arithmeticArea: Floating point numbers and arithmeticA-fmtArea: `core::fmt`Area: `core::fmt`C-bugCategory: This is a bug.Category: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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.NwhereNis an integer specifying the precision.The bug is that it is not documented that
Ncan 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
Nmeans 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".