-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Tracking Issue for clamp_min and clamp_max #147781
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-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.
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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Feature gate:
#![feature(clamp_to)], as well as possibly perma-unstable#[feature(clamp_bounds)].This is a tracking issue for rust-lang/libs-team#665, which adds less confusable alternatives for
x.min(y)andx.max(y).Public API
Steps / History
(Remember to update the
S-tracking-*label when checking boxes.).min()and.max()libs-team#665Unresolved Questions
Is having these functions, where clamp_min == max, actually less confusing than the status quo?clamp_towith ranges.x.max(y)withx.clamp_to(y..)?NAN.max(0.0)is 0, whileNAN.clamp(0.0, 0.0)is NaN, and0.0.clamp(NAN, NAN)panics.Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩