Skip to content

Conversation

@SciMind2460
Copy link
Contributor

Since the constants fxx::MAX and fxx:MIN mirror each other, I thought it would be a good idea to add constants that fxx::MIN_POSITIVE mirrors. Hence, I have added: fxx::MAX_NEGATIVE.

#116909 is a related issue.

@rustbot
Copy link
Collaborator

rustbot commented May 20, 2025

r? @joboet

rustbot has assigned @joboet.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 May 20, 2025
@workingjubilee
Copy link
Member

Please do not have commits with messages like "Update f32.rs". Describe what is actually done.

@rust-log-analyzer

This comment has been minimized.

@joboet
Copy link
Member

joboet commented May 23, 2025

r? libs-api

@rustbot rustbot added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label May 23, 2025
@rustbot rustbot assigned BurntSushi and unassigned joboet May 23, 2025
Comment on lines 447 to 453
/// Largest negative normal `f32` value.
///
/// Equal to &minus;2<sup>[`MIN_EXP`]&nbsp;&minus;&nbsp;1</sup>.
///
/// [`MIN_EXP`]: f32::MIN_EXP
#[stable(feature = "assoc_int_consts", since = "1.43.0")]
pub const MAX_NEGATIVE: f32 = -1.17549435e-38_f32;
Copy link
Contributor

Choose a reason for hiding this comment

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

How could this constant be stable since 1.43 when you are adding it now? :)

New API needs an unstable gate first, and is moved to stable later.

@tgross35
Copy link
Contributor

tgross35 commented Jun 2, 2025

API changes need an API change proposal (ACP), which is an issue template at https://github.com/rust-lang/libs-team. You'll have to justify the use case a bit.

Personally I'm hesitant to add more repr-specific (i.e. non-mathematical) constants until we discuss something about the confusing names of the constants we do have, cc #88734.

@SciMind2460
Copy link
Contributor Author

@tgross35 Fair enough. I thought that given that there is already MIN_POSITIVE, MAX_NEGATIVE added more symmetry between both constants.

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

Labels

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. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants