-
-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Tracking Issue for float conversion methods (float_conversions) #159913
Copy link
Copy link
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-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.
Description
Activity
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-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.
Feature gate:
#![feature(float_conversions)]This is a tracking issue for the float conversion methods from ACP rust-lang/libs-team#810:
cast(float to float),to_int_saturating,to_int_checked, andto_int_strictonf16,f32,f64, andf128.Public API
castisself as Flt.to_int_saturatingisself as Int(saturating,NaNto 0, per the libs-api decision).to_int_checkedtruncates toward zero and returnsNoneonNaN, infinity, or out of range.to_int_strictisto_int_checked().unwrap().Steps / History
(Remember to update the
S-tracking-*label when checking boxes.)Unresolved Questions
castfrom integers to floats. It shares thecastmethod name on integer types with the integer-to-integercastfrom ACP: convenient numeric conversions dependent on overflow-checks libs-team#811, which is being unified with the rest of the integer cast methods in the meta-ACP Meta-ACP: Integer cast methods libs-team#833, so it is left out here until that naming settles.to_int_wrapping(float to int) is an open question in the ACP and is not included.