rust/library
许杰友 Jieyou Xu (Joe) 61671a7e34
Rollup merge of #125253 - sunsided:feature/FRAC_1_SQRT_PI, r=Mark-Simulacrum
Add `FRAC_1_SQRT_2PI` constant to f16/f32/f64/f128

This adds the `FRAC_1_SQRT_2PI` to the `f16`, `f32`, `f64` and `f128` as [`1/√(2π)`](https://www.wolframalpha.com/input?i=1%2Fsqrt%282*pi%29). The rationale is that while `FRAC_1_SQRT_PI` already exists, [Gaussian calculations](https://en.wikipedia.org/wiki/Gaussian_function) for random normal distributions require a `1/(σ√(2π))` term, which could then be directly expressed e.g. as `f32::FRAC_1_SQRT_2PI / sigma`.

The actual value is approximately `1/√(2π) = 0.3989422804014326779399460599343818684758586311649346576659258296…`. Truncated/rounded forms were used for the individual types.

---

~~I did not any of the `#[unstable]` attributes since I am not aware of their implications.~~

**Edit:** I applied the stability attributes from the surrounding types according to what seemed most likely correct. I believe the `more_float_constants` feature marker is incorrectly applied, but I wasn't sure how to proceed.
2024-06-09 19:16:19 +01:00
..
alloc Rollup merge of #125951 - slanterns:error_in_core_stabilization, r=Amanieu 2024-06-08 04:25:44 +02:00
backtrace@72265bea21 Update backtrace to 0.3.73 2024-06-06 22:50:45 -07:00
core Rollup merge of #125253 - sunsided:feature/FRAC_1_SQRT_PI, r=Mark-Simulacrum 2024-06-09 19:16:19 +01:00
panic_abort Add support for Arm64EC to the Standard Library 2024-04-15 16:05:16 -07:00
panic_unwind Replace libc::c_int with core::ffi::c_int 2024-04-14 07:11:51 +00:00
portable-simd Rollup merge of #123168 - joshtriplett:size-of-prelude, r=Amanieu 2024-06-05 01:14:29 -07:00
proc_macro Rollup merge of #123168 - joshtriplett:size-of-prelude, r=Amanieu 2024-06-05 01:14:29 -07:00
profiler_builtins Update cc crate to v1.0.97 2024-05-08 15:06:35 +00:00
rtstartup library: Fix warnings in rtstartup 2024-01-06 01:32:03 +03:00
rustc-std-workspace-alloc
rustc-std-workspace-core
rustc-std-workspace-std
std Rollup merge of #126168 - devnexen:current_exe_haiku_simpl, r=ChrisDenton 2024-06-09 10:17:09 +02:00
stdarch@df3618d9f3 feat: update stdarch submodule for intrinsics on ARM 2024-05-15 15:38:58 -04:00
sysroot Add flag to sysroot 2024-05-11 14:31:55 +02:00
test Apply x clippy --fix and x fmt 2024-05-30 09:51:27 +08:00
unwind Fix unwinding on 32-bit watchOS ARM 2024-05-05 15:41:55 +02:00