Files
rust/library/core/src
许杰友 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
..
2024-05-20 19:21:30 -04:00
2024-02-13 12:04:44 +01:00
2024-05-09 17:04:30 +02:00
2024-05-04 22:56:35 +01:00
2024-05-20 22:46:13 +09:00
2024-05-27 11:08:21 +02:00
2024-03-29 17:10:17 +01:00
2024-06-04 10:51:05 +02:00
2024-05-25 15:00:59 -04:00
2024-06-02 18:15:50 +02:00
2024-05-21 19:05:37 -07:00
2024-03-29 10:10:52 -07:00
2024-03-07 07:49:22 +01:00
2024-05-09 17:04:30 +02:00
2023-04-16 07:20:26 +00:00
2023-07-28 14:46:17 +02:00
2024-05-23 18:45:03 +02:00
2024-05-01 22:19:11 -04:00
2023-09-06 09:47:22 -07:00
2024-05-09 17:04:30 +02:00
2024-06-06 20:01:59 +02:00
2024-05-01 22:19:11 -04:00
2024-04-08 11:57:17 +00:00
2024-06-07 12:18:43 -07:00