about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/core.rc2
-rw-r--r--src/libcore/num/f32.rs2
-rw-r--r--src/libcore/num/f64.rs2
-rw-r--r--src/libcore/num/float.rs2
-rw-r--r--src/libcore/num/num.rs6
-rw-r--r--src/libcore/prelude.rs2
6 files changed, 11 insertions, 5 deletions
diff --git a/src/libcore/core.rc b/src/libcore/core.rc
index 979a02d9f9c..bf92a30f7ce 100644
--- a/src/libcore/core.rc
+++ b/src/libcore/core.rc
@@ -105,7 +105,7 @@ pub use iter::{ExtendedMutableIter};
 
 pub use num::{Num, NumCast};
 pub use num::{Orderable, Signed, Unsigned, Round};
-pub use num::{Algebraic, Trigonometric, Exponential};
+pub use num::{Algebraic, Trigonometric, Exponential, Hyperbolic};
 pub use num::{Integer, Fractional, Real, RealExt};
 pub use num::{Bitwise, BitCount, Bounded};
 pub use num::{Primitive, Int, Float};
diff --git a/src/libcore/num/f32.rs b/src/libcore/num/f32.rs
index 8c34219ae21..e687f482fa9 100644
--- a/src/libcore/num/f32.rs
+++ b/src/libcore/num/f32.rs
@@ -425,7 +425,9 @@ impl Exponential for f32 {
 
     #[inline(always)]
     fn log10(&self) -> f32 { log10(*self) }
+}
 
+impl Hyperbolic for f32 {
     #[inline(always)]
     fn sinh(&self) -> f32 { sinh(*self) }
 
diff --git a/src/libcore/num/f64.rs b/src/libcore/num/f64.rs
index 19951ad7cff..d00e6ae2c0d 100644
--- a/src/libcore/num/f64.rs
+++ b/src/libcore/num/f64.rs
@@ -437,7 +437,9 @@ impl Exponential for f64 {
 
     #[inline(always)]
     fn log10(&self) -> f64 { log10(*self) }
+}
 
+impl Hyperbolic for f64 {
     #[inline(always)]
     fn sinh(&self) -> f64 { sinh(*self) }
 
diff --git a/src/libcore/num/float.rs b/src/libcore/num/float.rs
index c64f36f065f..3aa8848cdbe 100644
--- a/src/libcore/num/float.rs
+++ b/src/libcore/num/float.rs
@@ -547,7 +547,9 @@ impl Exponential for float {
     fn log10(&self) -> float {
         (*self as f64).log10() as float
     }
+}
 
+impl Hyperbolic for float {
     #[inline(always)]
     fn sinh(&self) -> float {
         (*self as f64).sinh() as float
diff --git a/src/libcore/num/num.rs b/src/libcore/num/num.rs
index 30a1213f7ff..3e43ebfef12 100644
--- a/src/libcore/num/num.rs
+++ b/src/libcore/num/num.rs
@@ -131,9 +131,9 @@ pub trait Exponential {
     fn log(&self) -> Self;
     fn log2(&self) -> Self;
     fn log10(&self) -> Self;
+}
 
-    // The Hyperbolic Functions are trivially implemented in terms of `exp`, so it's  simpler
-    // to group them within this trait. In the future these would have default implementations.
+pub trait Hyperbolic: Exponential {
     fn sinh(&self) -> Self;
     fn cosh(&self) -> Self;
     fn tanh(&self) -> Self;
@@ -146,7 +146,7 @@ pub trait Real: Signed
               + Fractional
               + Algebraic
               + Trigonometric
-              + Exponential {
+              + Hyperbolic {
     // Common Constants
     // FIXME (#5527): These should be associated constants
     fn pi() -> Self;
diff --git a/src/libcore/prelude.rs b/src/libcore/prelude.rs
index 1b20efe0cca..5fef01e65de 100644
--- a/src/libcore/prelude.rs
+++ b/src/libcore/prelude.rs
@@ -39,7 +39,7 @@ pub use iter::{CopyableIter, CopyableOrderedIter, CopyableNonstrictIter};
 pub use iter::{Times, ExtendedMutableIter};
 pub use num::{Num, NumCast};
 pub use num::{Orderable, Signed, Unsigned, Round};
-pub use num::{Algebraic, Trigonometric, Exponential};
+pub use num::{Algebraic, Trigonometric, Exponential, Hyperbolic};
 pub use num::{Integer, Fractional, Real, RealExt};
 pub use num::{Bitwise, BitCount, Bounded};
 pub use num::{Primitive, Int, Float};