-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Feature gate: #![feature(float_exact_integer_constants)]
This is a tracking issue for integer constants that represent the range of consecutive values that can be losslessly round-tripped to and from the corresponding floating point type. Additionally, integers within this range will convert to a floating point value that no other integer will convert to.
Public API
These constants are defined as ±(2mantissa_digits-1).
impl fN {
pub const MAX_EXACT_INTEGER: iN = (1 << Self::MANTISSA_DIGITS) - 1;
pub const MIN_EXACT_INTEGER: iN = -MAX_EXACT_INTEGER;
}Steps / History
- ACP: ACP: Add float constants for min/max limits of consecutive integers that convert to unique floats libs-team#713
- Implementation: core: Implement feature
float_exact_integer_constants#152512 - Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- Naming: If a better name comes up, it can be changed.
MAX_EXACT_INTEGERwas determined to be the best compromise of suggested names. ACP: Add float constants for min/max limits of consecutive integers that convert to unique floats libs-team#713 (comment):
Based on the options we've seen, we feel like
MAX_EXACT_INTEGERis a good balance between clarity and brevity. It does still have the property that one could interpret it as allowing one integer larger because that integer's truncated low bit would be 0, but we felt like any name trying to capture that property (and make it clear that the correct value is one less than the appropriate power of two) would be sufficiently verbose as to be less clear.
Footnotes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.