Skip to content

Conversation

@joshuarayton
Copy link
Contributor

@joshuarayton joshuarayton commented Jan 29, 2026

Add constants discussed in #146939 rust-lang/libs-team#661
Retry of #146934

r? @tgross35

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 29, 2026
@rust-log-analyzer

This comment has been minimized.

@joshuarayton
Copy link
Contributor Author

Not sure why this failed, #93784 seems to be relevant.

@rustbot

This comment has been minimized.

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small nits then LGTM

View changes since this review

Comment on lines 111 to 120
/// sqrt(5)
#[unstable(feature = "f128", issue = "116909")]
// Also, #[unstable(feature = "more_float_constants", issue = "146939")]
pub const SQRT_5: f128 = 2.23606797749978969640917366873127623544061835961152572427089_f128;

/// 1/sqrt(5)
#[unstable(feature = "f128", issue = "116909")]
// Also, #[unstable(feature = "more_float_constants", issue = "146939")]
pub const FRAC_1_SQRT_5: f128 =
0.447213595499957939281834733746255247088123671922305144854179_f128;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For f16 and f128, gate these under more_float_constants and leave the f128 gate in a comment. Bit safer since stabilizing this feature without f16/f128 would still not let you use these, but not the other way around.

/// sqrt(5)
#[unstable(feature = "f16", issue = "116909")]
// Also, #[unstable(feature = "more_float_constants", issue = "146939")]
pub const SQRT_5: f16 = 2.236067977499789696409173668731276235_f16;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extremely minor nit: the SQRT_5 value is correct, but it has 37 significant digits while we use 36 significant digits for f16/f32/f64. Mind chopping one off?

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(updating status)

View changes since this review

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 30, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 30, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot
Copy link
Collaborator

rustbot commented Feb 1, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thank you!

@bors r+ rollup

View changes since this review

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 2, 2026

📌 Commit caaee92 has been approved by tgross35

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 2, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Feb 2, 2026
rust-bors bot pushed a commit that referenced this pull request Feb 2, 2026
Rollup of 5 pull requests

Successful merges:

 - #151825 (more float constants)
 - #151958 (Add codegen test for SLP vectorization)
 - #151974 (Update documentation for `Result::ok()`)
 - #151978 (Query cleanups)
 - #151979 (Fix uninitialized UEFI globals in tests)
jhpratt added a commit to jhpratt/rust that referenced this pull request Feb 2, 2026
rust-bors bot pushed a commit that referenced this pull request Feb 2, 2026
Rollup of 5 pull requests

Successful merges:

 - #151938 (Use `#![feature(adt_const_params)]` for static query flags)
 - #151825 (more float constants)
 - #151974 (Update documentation for `Result::ok()`)
 - #151978 (Query cleanups)
 - #151979 (Fix uninitialized UEFI globals in tests)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 2, 2026
rust-bors bot pushed a commit that referenced this pull request Feb 2, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #150992 (link modifier `export-symbols`: export all global symbols from selected uptream c static libraries)
 - #151695 (compiletest: Support `--extern` modifiers with `proc-macro` directive)
 - #151938 (Use `#![feature(adt_const_params)]` for static query flags)
 - #151172 (Use default field values in a few more cases)
 - #151825 (more float constants)
 - #151870 (regression test for alias-relate changes in lub)
 - #151902 (explain why we dont skip some of this work when there are field projections)
 - #151974 (Update documentation for `Result::ok()`)
 - #151978 (Query cleanups)
 - #151979 (Fix uninitialized UEFI globals in tests)
 - #151992 (Port `#[rustc_hidden_type_of_opaque]` to attribute parser)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 2, 2026
rust-bors bot pushed a commit that referenced this pull request Feb 2, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #149596 (resolve: Report more visibility-related early resolution ambiguities for imports)
 - #151695 (compiletest: Support `--extern` modifiers with `proc-macro` directive)
 - #151938 (Use `#![feature(adt_const_params)]` for static query flags)
 - #151172 (Use default field values in a few more cases)
 - #151825 (more float constants)
 - #151870 (regression test for alias-relate changes in lub)
 - #151872 (Add inline syntax for diagnostic messages)
 - #151902 (explain why we dont skip some of this work when there are field projections)
 - #151909 (Skip overlapping spans in argument error suggestions)
 - #151978 (Query cleanups)
 - #151979 (Fix uninitialized UEFI globals in tests)
 - #151992 (Port `#[rustc_hidden_type_of_opaque]` to attribute parser)
rust-bors bot pushed a commit that referenced this pull request Feb 2, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #149596 (resolve: Report more visibility-related early resolution ambiguities for imports)
 - #151695 (compiletest: Support `--extern` modifiers with `proc-macro` directive)
 - #151938 (Use `#![feature(adt_const_params)]` for static query flags)
 - #151172 (Use default field values in a few more cases)
 - #151825 (more float constants)
 - #151870 (regression test for alias-relate changes in lub)
 - #151872 (Add inline syntax for diagnostic messages)
 - #151902 (explain why we dont skip some of this work when there are field projections)
 - #151909 (Skip overlapping spans in argument error suggestions)
 - #151978 (Query cleanups)
 - #151979 (Fix uninitialized UEFI globals in tests)
 - #151992 (Port `#[rustc_hidden_type_of_opaque]` to attribute parser)
rust-bors bot pushed a commit that referenced this pull request Feb 3, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #149596 (resolve: Report more visibility-related early resolution ambiguities for imports)
 - #151695 (compiletest: Support `--extern` modifiers with `proc-macro` directive)
 - #151938 (Use `#![feature(adt_const_params)]` for static query flags)
 - #151172 (Use default field values in a few more cases)
 - #151825 (more float constants)
 - #151870 (regression test for alias-relate changes in lub)
 - #151872 (Add inline syntax for diagnostic messages)
 - #151902 (explain why we dont skip some of this work when there are field projections)
 - #151909 (Skip overlapping spans in argument error suggestions)
 - #151978 (Query cleanups)
 - #151979 (Fix uninitialized UEFI globals in tests)
 - #151992 (Port `#[rustc_hidden_type_of_opaque]` to attribute parser)
@rust-bors rust-bors bot merged commit f0355cc into rust-lang:main Feb 3, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 3, 2026
rust-timer added a commit that referenced this pull request Feb 3, 2026
Rollup merge of #151825 - joshuarayton:more-float-constants, r=tgross35

more float constants

Add constants discussed in #146939 rust-lang/libs-team#661
Retry of #146934

r? @tgross35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants