-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add constant MAX_NEGATIVE
to each floating-point value
#141290
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
base: master
Are you sure you want to change the base?
Conversation
Please do not have commits with messages like "Update f32.rs". Describe what is actually done. |
The job Click to see the possible cause of the failure (guessed by this bot)
|
r? libs-api |
/// Largest negative normal `f32` value. | ||
/// | ||
/// Equal to −2<sup>[`MIN_EXP`] − 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; |
There was a problem hiding this comment.
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.
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. |
@tgross35 Fair enough. I thought that given that there is already |
Since the constants
fxx::MAX
andfxx:MIN
mirror each other, I thought it would be a good idea to add constants thatfxx::MIN_POSITIVE
mirrors. Hence, I have added:fxx::MAX_NEGATIVE
.#116909 is a related issue.