diff options
author | Justin Worthe <justin.worthe@gmail.com> | 2017-02-21 20:38:58 +0200 |
---|---|---|
committer | Justin Worthe <justin.worthe@gmail.com> | 2017-02-21 20:38:58 +0200 |
commit | b374ec63bcd0d1634ee6c8cdfe7e96268ade3ab1 (patch) | |
tree | d371e0cb0756766eca1f017895fb5ed0be241f68 /src/num_traits.rs | |
parent | 16e2ffe8e73261937b1a9877ba4f9edde5781ef2 (diff) |
It looks this has been sitting in my directory for a while, and I just
forgot to push it.
Diffstat (limited to 'src/num_traits.rs')
-rw-r--r-- | src/num_traits.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/num_traits.rs b/src/num_traits.rs index 030e5c4..938bc9a 100644 --- a/src/num_traits.rs +++ b/src/num_traits.rs @@ -99,6 +99,8 @@ pub trait FractionOps { fn recip(self) -> Self; fn pi() -> Self; fn two_pi() -> Self; + fn half_pi() -> Self; + fn zero() -> Self; } macro_rules! impl_fraction_float { @@ -113,6 +115,12 @@ macro_rules! impl_fraction_float { fn two_pi() -> Self { 2.0 * $pi } + fn half_pi() -> Self { + $pi / 2.0 + } + fn zero() -> Self { + 0.0 + } } } } |