about summary refs log tree commit diff
path: root/src/libextra
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-01-17 20:36:47 -0800
committerbors <bors@rust-lang.org>2014-01-17 20:36:47 -0800
commitc58d2bacb78ed0d2b9c0c0909e56f390b525aabd (patch)
treecfdb77d3b7fc5febbbe2e7cca33a4d1bb11efcd1 /src/libextra
parentf4498c71e21308f6657d0150d5f473835e4b436f (diff)
parented7e576d9cf807169b17b5a4c572e874e38681cf (diff)
downloadrust-c58d2bacb78ed0d2b9c0c0909e56f390b525aabd.tar.gz
rust-c58d2bacb78ed0d2b9c0c0909e56f390b525aabd.zip
auto merge of #11503 : FlaPer87/rust/master, r=huonw
The patch adds the missing pow method for all the implementations of the
Integer trait. This is a small addition that will most likely be
improved by the work happening in #10387.

Fixes #11499
Diffstat (limited to 'src/libextra')
-rw-r--r--src/libextra/num/rational.rs12
-rw-r--r--src/libextra/stats.rs4
2 files changed, 8 insertions, 8 deletions
diff --git a/src/libextra/num/rational.rs b/src/libextra/num/rational.rs
index 4edccf685e2..c5b405a45aa 100644
--- a/src/libextra/num/rational.rs
+++ b/src/libextra/num/rational.rs
@@ -653,19 +653,19 @@ mod test {
 
         // f32
         test(3.14159265359f32, ("13176795", "4194304"));
-        test(2f32.pow(&100.), ("1267650600228229401496703205376", "1"));
-        test(-2f32.pow(&100.), ("-1267650600228229401496703205376", "1"));
-        test(1.0 / 2f32.pow(&100.), ("1", "1267650600228229401496703205376"));
+        test(2f32.powf(&100.), ("1267650600228229401496703205376", "1"));
+        test(-2f32.powf(&100.), ("-1267650600228229401496703205376", "1"));
+        test(1.0 / 2f32.powf(&100.), ("1", "1267650600228229401496703205376"));
         test(684729.48391f32, ("1369459", "2"));
         test(-8573.5918555f32, ("-4389679", "512"));
 
         // f64
         test(3.14159265359f64, ("3537118876014453", "1125899906842624"));
-        test(2f64.pow(&100.), ("1267650600228229401496703205376", "1"));
-        test(-2f64.pow(&100.), ("-1267650600228229401496703205376", "1"));
+        test(2f64.powf(&100.), ("1267650600228229401496703205376", "1"));
+        test(-2f64.powf(&100.), ("-1267650600228229401496703205376", "1"));
         test(684729.48391f64, ("367611342500051", "536870912"));
         test(-8573.5918555, ("-4713381968463931", "549755813888"));
-        test(1.0 / 2f64.pow(&100.), ("1", "1267650600228229401496703205376"));
+        test(1.0 / 2f64.powf(&100.), ("1", "1267650600228229401496703205376"));
     }
 
     #[test]
diff --git a/src/libextra/stats.rs b/src/libextra/stats.rs
index 629d826c37b..2e953575410 100644
--- a/src/libextra/stats.rs
+++ b/src/libextra/stats.rs
@@ -349,8 +349,8 @@ pub fn write_boxplot(w: &mut io::Writer, s: &Summary, width_hint: uint) {
     let (q1,q2,q3) = s.quartiles;
 
     // the .abs() handles the case where numbers are negative
-    let lomag = (10.0_f64).pow(&(s.min.abs().log10().floor()));
-    let himag = (10.0_f64).pow(&(s.max.abs().log10().floor()));
+    let lomag = (10.0_f64).powf(&(s.min.abs().log10().floor()));
+    let himag = (10.0_f64).powf(&(s.max.abs().log10().floor()));
 
     // need to consider when the limit is zero
     let lo = if lomag == 0.0 {