Closed
Description
This is a tracking issue for the APIs f32::total_cmp
, f64::total_cmp
( #72568 )
The feature gate for the issue is #![feature(total_cmp)]
.
Overview of the API
- Implements method
total_cmp
onf32
andf64
. This method implements a float comparison that, unlike the standardpartial_cmp
, is total (defined on all values) in accordance to the IEEE 754 (rev 2008) §5.10totalOrder
predicate. - The method has an API similar to
cmp
:pub fn total_cmp(&self, other: &Self) -> crate::cmp::Ordering { ... }
.
Steps
- Implement the RFC
- FCP
- Stabilization PR
- Update docs to not promise more than we can.
Unresolved Questions
- The exact ordering required by IEEE 754, revisions 2008 and 2019, isn't followed on some Tier 2 platforms, namely, older MIPS systems. The problem is that on those platforms, the meaning of the "signaling NaN" and "quiet NaN" bit is reversed. This means the order of those NaNs is reverse on those platfroms. Newer MIPS chips have a flag for the user to choose the behaviour. Should we add a special mention about this in the documentation, or just ignore the problem, as it's 1) not very common (being Tier 2 and all) 2) minor (reversal of order of sNaN and qNaN is unlikely to matter in real-life situations, and in those kinds of situations, the user is usually aware of the problem) 3) going away. (The newer systems addressing this problem.)
Implementation history
Metadata
Metadata
Assignees
Labels
Area: Floating point numbers and arithmeticBlocker: Implemented in the nightly compiler and unstable.Category: An issue tracking the progress of sth. like the implementation of an RFCCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Libs issues that are tracked on the team's project board.Relevant to the library API team, which will review and decide on the PR/issue.This issue / PR is in PFCP or FCP with a disposition to merge it.The final comment period is finished for this PR / Issue.