Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking issue for #![feature(const_float_classify)] #72505

Closed
ecstatic-morse opened this issue May 23, 2020 · 5 comments · Fixed by #130157
Closed

Tracking issue for #![feature(const_float_classify)] #72505

ecstatic-morse opened this issue May 23, 2020 · 5 comments · Fixed by #130157
Assignees
Labels
A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) A-floating-point Area: Floating point numbers and arithmetic B-unstable Blocker: Implemented in the nightly compiler and unstable. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. Libs-Tracked Libs issues that are tracked on the team's project board. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@ecstatic-morse
Copy link
Contributor

ecstatic-morse commented May 23, 2020

Tracking issue for the #![feature(const_float_classify)] feature gate, which makes the following methods on f32 and f64 const fn:

  • classify
  • is_nan
  • is_infinite
  • is_finite
  • is_subnormal
  • is_normal
  • is_sign_positive
  • is_sign_negative

These require #72447 (#![feature(const_float_bits_conv)]), so this is transitively blocked on #57241.

@ecstatic-morse ecstatic-morse self-assigned this May 23, 2020
@ecstatic-morse ecstatic-morse added A-const-fn C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels May 23, 2020
RalfJung added a commit to RalfJung/rust that referenced this issue Jun 12, 2020
… r=RalfJung,oli-obk

Const floating point bitcasts and classification

Makes the `f32` and `f64` methods described in rust-lang#72447 and rust-lang#72505 unstably const.

r? @RalfJung
@KodrAus KodrAus added A-floating-point Area: Floating point numbers and arithmetic B-unstable Blocker: Implemented in the nightly compiler and unstable. Libs-Tracked Libs issues that are tracked on the team's project board. labels Jul 29, 2020
bors added a commit to rust-lang-ci/rust that referenced this issue Aug 23, 2020
…=RalfJung

Const floating point bitcasts and classification

Makes the `f32` and `f64` methods described in rust-lang#72447 and rust-lang#72505 unstably const.

r? @RalfJung
@RalfJung
Copy link
Member

RalfJung commented Aug 3, 2024

#57241 is being proposed for stabilization, so this feature is also finally (transitively) unblocked. :)

Note that #114486 should also be reverted when is_nan becomes const-stable.

@rfcbot
Copy link

rfcbot commented Sep 12, 2024

Team member @dtolnay has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Sep 12, 2024
@rfcbot rfcbot added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Sep 24, 2024
@rfcbot
Copy link

rfcbot commented Sep 24, 2024

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Oct 4, 2024
@rfcbot
Copy link

rfcbot commented Oct 4, 2024

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

@bors bors closed this as completed in 14f303b Oct 4, 2024
lnicola pushed a commit to lnicola/rust-analyzer that referenced this issue Oct 8, 2024
…alfJung

Stabilize `const_float_classify`

Tracking issue: rust-lang/rust#72505

Also reverts rust-lang/rust#114486

Closes rust-lang/rust#72505

Stabilized const API:

```rust
impl f32 {
    pub const fn is_nan(self) -> bool;
    pub const fn is_infinite(self) -> bool;
    pub const fn is_finite(self) -> bool;
    pub const fn is_subnormal(self) -> bool;
    pub const fn is_normal(self) -> bool;
    pub const fn classify(self) -> FpCategory;
    pub const fn is_sign_positive(self) -> bool;
    pub const fn is_sign_negative(self) -> bool;
}

impl f64 {
    pub const fn is_nan(self) -> bool;
    pub const fn is_infinite(self) -> bool;
    pub const fn is_finite(self) -> bool;
    pub const fn is_subnormal(self) -> bool;
    pub const fn is_normal(self) -> bool;
    pub const fn classify(self) -> FpCategory;
    pub const fn is_sign_positive(self) -> bool;
    pub const fn is_sign_negative(self) -> bool;
}
```

cc `@rust-lang/wg-const-eval` `@rust-lang/libs-api`
RalfJung pushed a commit to RalfJung/miri that referenced this issue Oct 14, 2024
…alfJung

Stabilize `const_float_classify`

Tracking issue: rust-lang/rust#72505

Also reverts rust-lang/rust#114486

Closes rust-lang/rust#72505

Stabilized const API:

```rust
impl f32 {
    pub const fn is_nan(self) -> bool;
    pub const fn is_infinite(self) -> bool;
    pub const fn is_finite(self) -> bool;
    pub const fn is_subnormal(self) -> bool;
    pub const fn is_normal(self) -> bool;
    pub const fn classify(self) -> FpCategory;
    pub const fn is_sign_positive(self) -> bool;
    pub const fn is_sign_negative(self) -> bool;
}

impl f64 {
    pub const fn is_nan(self) -> bool;
    pub const fn is_infinite(self) -> bool;
    pub const fn is_finite(self) -> bool;
    pub const fn is_subnormal(self) -> bool;
    pub const fn is_normal(self) -> bool;
    pub const fn classify(self) -> FpCategory;
    pub const fn is_sign_positive(self) -> bool;
    pub const fn is_sign_negative(self) -> bool;
}
```

cc `@rust-lang/wg-const-eval` `@rust-lang/libs-api`
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Oct 17, 2024
@RalfJung RalfJung added the A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) label Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) A-floating-point Area: Floating point numbers and arithmetic B-unstable Blocker: Implemented in the nightly compiler and unstable. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. Libs-Tracked Libs issues that are tracked on the team's project board. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants