Skip to content

Commit 50173bd

Browse files
committed
Add TAU to floating point consts.
1 parent 5dce719 commit 50173bd

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/libcore/num/f32.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ pub mod consts {
104104
#[stable(feature = "rust1", since = "1.0.0")]
105105
pub const FRAC_2_SQRT_PI: f32 = 1.12837916709551257389615890312154517_f32;
106106

107+
/// 2π, the ratio of a circle's circumference to its radius.
108+
pub const TAU: f32 = 6.28318530717958647692528676655900577_f32;
109+
107110
/// sqrt(2)
108111
#[stable(feature = "rust1", since = "1.0.0")]
109112
pub const SQRT_2: f32 = 1.41421356237309504880168872420969808_f32;

src/libcore/num/f64.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ pub mod consts {
100100
#[stable(feature = "rust1", since = "1.0.0")]
101101
pub const FRAC_2_PI: f64 = 0.636619772367581343075535053490057448_f64;
102102

103+
/// 2π, the ratio of a circle's circumference to its radius.
104+
pub const TAU: f64 = 6.28318530717958647692528676655900577_f64;
105+
103106
/// 2/sqrt(π)
104107
#[stable(feature = "rust1", since = "1.0.0")]
105108
pub const FRAC_2_SQRT_PI: f64 = 1.12837916709551257389615890312154517_f64;

0 commit comments

Comments
 (0)