diff options
| author | Markus Mayer <widemeadows@gmail.com> | 2024-05-22 11:07:08 +0200 |
|---|---|---|
| committer | Markus Mayer <widemeadows@gmail.com> | 2024-05-29 09:30:28 +0200 |
| commit | eb729380499b12cb539d665221d5930a06467024 (patch) | |
| tree | c790ead5a6f8b8c4ae05d684b7e332acf4a8c8ad | |
| parent | 685a80f7a0935c8e5016d8c9cd491937af155dd0 (diff) | |
| download | rust-eb729380499b12cb539d665221d5930a06467024.tar.gz rust-eb729380499b12cb539d665221d5930a06467024.zip | |
Add FRAC_1_SQRT_2PI constant to f16/f32/f64/f128
| -rw-r--r-- | library/core/src/num/f128.rs | 6 | ||||
| -rw-r--r-- | library/core/src/num/f16.rs | 5 | ||||
| -rw-r--r-- | library/core/src/num/f32.rs | 4 | ||||
| -rw-r--r-- | library/core/src/num/f64.rs | 4 |
4 files changed, 19 insertions, 0 deletions
diff --git a/library/core/src/num/f128.rs b/library/core/src/num/f128.rs index 9362dc87654..75eed264858 100644 --- a/library/core/src/num/f128.rs +++ b/library/core/src/num/f128.rs @@ -68,6 +68,12 @@ pub mod consts { pub const FRAC_1_SQRT_PI: f128 = 0.564189583547756286948079451560772585844050629328998856844086_f128; + /// 1/sqrt(2π) + #[unstable(feature = "f128", issue = "116909")] + // Also, #[unstable(feature = "more_float_constants", issue = "103883")] + pub const FRAC_1_SQRT_2PI: f128 = + 0.398942280401432677939946059934381868475858631164934657665926_f128; + /// 2/π #[unstable(feature = "f128", issue = "116909")] pub const FRAC_2_PI: f128 = 0.636619772367581343075535053490057448137838582961825794990669_f128; diff --git a/library/core/src/num/f16.rs b/library/core/src/num/f16.rs index c4d4584544b..955314516a4 100644 --- a/library/core/src/num/f16.rs +++ b/library/core/src/num/f16.rs @@ -67,6 +67,11 @@ pub mod consts { // Also, #[unstable(feature = "more_float_constants", issue = "103883")] pub const FRAC_1_SQRT_PI: f16 = 0.564189583547756286948079451560772586_f16; + /// 1/sqrt(2π) + #[unstable(feature = "f16", issue = "116909")] + // Also, #[unstable(feature = "more_float_constants", issue = "103883")] + pub const FRAC_1_SQRT_2PI: f16 = 0.398942280401432677939946059934381868_f16; + /// 2/π #[unstable(feature = "f16", issue = "116909")] pub const FRAC_2_PI: f16 = 0.636619772367581343075535053490057448_f16; diff --git a/library/core/src/num/f32.rs b/library/core/src/num/f32.rs index 2e715fb0bdd..8c591af3c0d 100644 --- a/library/core/src/num/f32.rs +++ b/library/core/src/num/f32.rs @@ -327,6 +327,10 @@ pub mod consts { #[unstable(feature = "more_float_constants", issue = "103883")] pub const FRAC_1_SQRT_PI: f32 = 0.564189583547756286948079451560772586_f32; + /// 1/sqrt(2π) + #[unstable(feature = "more_float_constants", issue = "103883")] + pub const FRAC_1_SQRT_2PI: f32 = 0.398942280401432677939946059934381868_f32; + /// 2/π #[stable(feature = "rust1", since = "1.0.0")] pub const FRAC_2_PI: f32 = 0.636619772367581343075535053490057448_f32; diff --git a/library/core/src/num/f64.rs b/library/core/src/num/f64.rs index db8e1f318ad..db458c4375c 100644 --- a/library/core/src/num/f64.rs +++ b/library/core/src/num/f64.rs @@ -327,6 +327,10 @@ pub mod consts { #[unstable(feature = "more_float_constants", issue = "103883")] pub const FRAC_1_SQRT_PI: f64 = 0.564189583547756286948079451560772586_f64; + /// 1/sqrt(2π) + #[unstable(feature = "more_float_constants", issue = "103883")] + pub const FRAC_1_SQRT_2PI: f64 = 0.398942280401432677939946059934381868_f64; + /// 2/π #[stable(feature = "rust1", since = "1.0.0")] pub const FRAC_2_PI: f64 = 0.636619772367581343075535053490057448_f64; |
