Browse Source

Add the full circle constant τ.

Mara Bos 5 years ago
parent
commit
ad583c2d82
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/float.rs

+ 2 - 0
src/float.rs

@@ -2247,6 +2247,7 @@ macro_rules! float_const_impl {
         #[allow(non_snake_case)]
         pub trait FloatConst {
             $(#[$doc] fn $constant() -> Self;)+
+            #[doc = "Return the full circle constant `τ`."] fn TAU() -> Self;
         }
         float_const_impl! { @float f32, $($constant,)+ }
         float_const_impl! { @float f64, $($constant,)+ }
@@ -2255,6 +2256,7 @@ macro_rules! float_const_impl {
         impl FloatConst for $T {
             constant! {
                 $( $constant() -> $T::consts::$constant; )+
+                TAU() -> 6.28318530717958647692528676655900577;
             }
         }
     );