Skip to content

Commit 4c51d58

Browse files
authored
Rollup merge of rust-lang#66769 - fusion-engineering-forks:tau-constant, r=dtolnay
Add core::{f32,f64}::consts::TAU. ### **`τ`**
2 parents b05f14c + d220ed4 commit 4c51d58

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/libcore/num/f32.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ pub mod consts {
7575
#[stable(feature = "rust1", since = "1.0.0")]
7676
pub const PI: f32 = 3.14159265358979323846264338327950288_f32;
7777

78+
/// The full circle constant (τ)
79+
///
80+
/// Equal to 2π.
81+
#[unstable(feature = "tau_constant", issue = "66770")]
82+
pub const TAU: f32 = 6.28318530717958647692528676655900577_f32;
83+
7884
/// π/2
7985
#[stable(feature = "rust1", since = "1.0.0")]
8086
pub const FRAC_PI_2: f32 = 1.57079632679489661923132169163975144_f32;

src/libcore/num/f64.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ pub mod consts {
7575
#[stable(feature = "rust1", since = "1.0.0")]
7676
pub const PI: f64 = 3.14159265358979323846264338327950288_f64;
7777

78+
/// The full circle constant (τ)
79+
///
80+
/// Equal to 2π.
81+
#[unstable(feature = "tau_constant", issue = "66770")]
82+
pub const TAU: f64 = 6.28318530717958647692528676655900577_f64;
83+
7884
/// π/2
7985
#[stable(feature = "rust1", since = "1.0.0")]
8086
pub const FRAC_PI_2: f64 = 1.57079632679489661923132169163975144_f64;

0 commit comments

Comments
 (0)