-
Notifications
You must be signed in to change notification settings - Fork 13.3k
f*::NAN: guarantee that this is a quiet NaN #139483
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
@rfcbot merge |
Team member @m-ou-se 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. |
The Miri subtree was changed cc @rust-lang/miri |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
Is it worth considering the alternative of making no guarantees about |
I think adding a |
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. |
r? tgross35 |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#139351 (Autodiff batching2) - rust-lang#139483 (f*::NAN: guarantee that this is a quiet NaN) - rust-lang#139498 (Ignore zero-sized types in wasm future-compat warning) - rust-lang#139967 (Introduce and use specialized `//@ ignore-auxiliary` for test support files instead of using `//@ ignore-test`) - rust-lang#139969 (update libc) - rust-lang#139971 (Make C string merging test work on MIPS) - rust-lang#139974 (Change `InterpCx::instantiate*` function visibility to pub) - rust-lang#139977 (Fix drop handling in `hint::select_unpredictable`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#139483 - RalfJung:nan, r=tgross35 f*::NAN: guarantee that this is a quiet NaN I think we should guarantee that this is a quiet NaN. This then implies that programs not using `f*::from_bits` (or unsafe type conversions) are guaranteed to only work with quiet NaNs. It would be awkward if people start to write `0.0 / 0.0` instead of using the constant just because they want to get a guaranteed-quiet NaN. This is a `@rust-lang/libs-api` change. The definition of this constant currently is `0.0 / 0.0`, which is already guaranteed to be a quiet NaN. So all this does is forward that guarantee to our users.
I didn't think of this until just now but we should add a test ensuring the top mantissa bit is set |
f*::NAN: guarantee that this is a quiet NaN I think we should guarantee that this is a quiet NaN. This then implies that programs not using `f*::from_bits` (or unsafe type conversions) are guaranteed to only work with quiet NaNs. It would be awkward if people start to write `0.0 / 0.0` instead of using the constant just because they want to get a guaranteed-quiet NaN. This is a `@rust-lang/libs-api` change. The definition of this constant currently is `0.0 / 0.0`, which is already guaranteed to be a quiet NaN. So all this does is forward that guarantee to our users.
@tgross35 what's the best way to get the top mantissa bit for our various float types? |
I think |
I think we should guarantee that this is a quiet NaN. This then implies that programs not using
f*::from_bits
(or unsafe type conversions) are guaranteed to only work with quiet NaNs. It would be awkward if people start to write0.0 / 0.0
instead of using the constant just because they want to get a guaranteed-quiet NaN.This is a @rust-lang/libs-api change. The definition of this constant currently is
0.0 / 0.0
, which is already guaranteed to be a quiet NaN. So all this does is forward that guarantee to our users.