about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/num/f32.rs8
-rw-r--r--src/libstd/num/f64.rs8
-rw-r--r--src/libstd/num/float.rs16
-rw-r--r--src/libstd/num/num.rs8
4 files changed, 20 insertions, 20 deletions
diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs
index 62ce5ed65e1..7f981187300 100644
--- a/src/libstd/num/f32.rs
+++ b/src/libstd/num/f32.rs
@@ -391,7 +391,7 @@ impl Fractional for f32 {
 
 impl Algebraic for f32 {
     #[inline(always)]
-    fn pow(&self, n: f32) -> f32 { pow(*self, n) }
+    fn pow(&self, n: &f32) -> f32 { pow(*self, *n) }
 
     #[inline(always)]
     fn sqrt(&self) -> f32 { sqrt(*self) }
@@ -403,7 +403,7 @@ impl Algebraic for f32 {
     fn cbrt(&self) -> f32 { cbrt(*self) }
 
     #[inline(always)]
-    fn hypot(&self, other: f32) -> f32 { hypot(*self, other) }
+    fn hypot(&self, other: &f32) -> f32 { hypot(*self, *other) }
 }
 
 impl Trigonometric for f32 {
@@ -426,7 +426,7 @@ impl Trigonometric for f32 {
     fn atan(&self) -> f32 { atan(*self) }
 
     #[inline(always)]
-    fn atan2(&self, other: f32) -> f32 { atan2(*self, other) }
+    fn atan2(&self, other: &f32) -> f32 { atan2(*self, *other) }
 
     /// Simultaneously computes the sine and cosine of the number
     #[inline(always)]
@@ -450,7 +450,7 @@ impl Exponential for f32 {
 
     /// Returns the logarithm of the number with respect to an arbitrary base
     #[inline(always)]
-    fn log(&self, base: f32) -> f32 { self.ln() / base.ln() }
+    fn log(&self, base: &f32) -> f32 { self.ln() / base.ln() }
 
     /// Returns the base 2 logarithm of the number
     #[inline(always)]
diff --git a/src/libstd/num/f64.rs b/src/libstd/num/f64.rs
index de44d861645..6303e304576 100644
--- a/src/libstd/num/f64.rs
+++ b/src/libstd/num/f64.rs
@@ -403,7 +403,7 @@ impl Fractional for f64 {
 
 impl Algebraic for f64 {
     #[inline(always)]
-    fn pow(&self, n: f64) -> f64 { pow(*self, n) }
+    fn pow(&self, n: &f64) -> f64 { pow(*self, *n) }
 
     #[inline(always)]
     fn sqrt(&self) -> f64 { sqrt(*self) }
@@ -415,7 +415,7 @@ impl Algebraic for f64 {
     fn cbrt(&self) -> f64 { cbrt(*self) }
 
     #[inline(always)]
-    fn hypot(&self, other: f64) -> f64 { hypot(*self, other) }
+    fn hypot(&self, other: &f64) -> f64 { hypot(*self, *other) }
 }
 
 impl Trigonometric for f64 {
@@ -438,7 +438,7 @@ impl Trigonometric for f64 {
     fn atan(&self) -> f64 { atan(*self) }
 
     #[inline(always)]
-    fn atan2(&self, other: f64) -> f64 { atan2(*self, other) }
+    fn atan2(&self, other: &f64) -> f64 { atan2(*self, *other) }
 
     /// Simultaneously computes the sine and cosine of the number
     #[inline(always)]
@@ -462,7 +462,7 @@ impl Exponential for f64 {
 
     /// Returns the logarithm of the number with respect to an arbitrary base
     #[inline(always)]
-    fn log(&self, base: f64) -> f64 { self.ln() / base.ln() }
+    fn log(&self, base: &f64) -> f64 { self.ln() / base.ln() }
 
     /// Returns the base 2 logarithm of the number
     #[inline(always)]
diff --git a/src/libstd/num/float.rs b/src/libstd/num/float.rs
index a96a854e6a0..267a8890e82 100644
--- a/src/libstd/num/float.rs
+++ b/src/libstd/num/float.rs
@@ -475,8 +475,8 @@ impl Fractional for float {
 
 impl Algebraic for float {
     #[inline(always)]
-    fn pow(&self, n: float) -> float {
-        (*self as f64).pow(n as f64) as float
+    fn pow(&self, n: &float) -> float {
+        (*self as f64).pow(&(*n as f64)) as float
     }
 
     #[inline(always)]
@@ -495,8 +495,8 @@ impl Algebraic for float {
     }
 
     #[inline(always)]
-    fn hypot(&self, other: float) -> float {
-        (*self as f64).hypot(other as f64) as float
+    fn hypot(&self, other: &float) -> float {
+        (*self as f64).hypot(&(*other as f64)) as float
     }
 }
 
@@ -532,8 +532,8 @@ impl Trigonometric for float {
     }
 
     #[inline(always)]
-    fn atan2(&self, other: float) -> float {
-        (*self as f64).atan2(other as f64) as float
+    fn atan2(&self, other: &float) -> float {
+        (*self as f64).atan2(&(*other as f64)) as float
     }
 
     /// Simultaneously computes the sine and cosine of the number
@@ -566,8 +566,8 @@ impl Exponential for float {
 
     /// Returns the logarithm of the number with respect to an arbitrary base
     #[inline(always)]
-    fn log(&self, base: float) -> float {
-        (*self as f64).log(base as f64) as float
+    fn log(&self, base: &float) -> float {
+        (*self as f64).log(&(*base as f64)) as float
     }
 
     /// Returns the base 2 logarithm of the number
diff --git a/src/libstd/num/num.rs b/src/libstd/num/num.rs
index 91631d3c9b9..a9893579721 100644
--- a/src/libstd/num/num.rs
+++ b/src/libstd/num/num.rs
@@ -106,11 +106,11 @@ pub trait Fractional: Num
 }
 
 pub trait Algebraic {
-    fn pow(&self, n: Self) -> Self;
+    fn pow(&self, n: &Self) -> Self;
     fn sqrt(&self) -> Self;
     fn rsqrt(&self) -> Self;
     fn cbrt(&self) -> Self;
-    fn hypot(&self, other: Self) -> Self;
+    fn hypot(&self, other: &Self) -> Self;
 }
 
 pub trait Trigonometric {
@@ -120,7 +120,7 @@ pub trait Trigonometric {
     fn asin(&self) -> Self;
     fn acos(&self) -> Self;
     fn atan(&self) -> Self;
-    fn atan2(&self, other: Self) -> Self;
+    fn atan2(&self, other: &Self) -> Self;
     fn sin_cos(&self) -> (Self, Self);
 }
 
@@ -128,7 +128,7 @@ pub trait Exponential {
     fn exp(&self) -> Self;
     fn exp2(&self) -> Self;
     fn ln(&self) -> Self;
-    fn log(&self, base: Self) -> Self;
+    fn log(&self, base: &Self) -> Self;
     fn log2(&self) -> Self;
     fn log10(&self) -> Self;
 }