diff options
| author | bors <bors@rust-lang.org> | 2014-11-18 13:41:38 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-11-18 13:41:38 +0000 |
| commit | d7a29d87ba6bfca0bfe6207a99c7ec2b7ce869b9 (patch) | |
| tree | d5ef76ecd61bb50bb094b01423893d1f49b42260 /src/libstd/num | |
| parent | 516ece6ee4393990b8a62fb8f16bb7423e0e8828 (diff) | |
| parent | 3fcf2840a484159c9e27601dc9480f9636d2f2e5 (diff) | |
| download | rust-d7a29d87ba6bfca0bfe6207a99c7ec2b7ce869b9.tar.gz rust-d7a29d87ba6bfca0bfe6207a99c7ec2b7ce869b9.zip | |
auto merge of #19031 : nodakai/rust/libcore-pow-and-sq, r=bjz
[breaking-change] Deprecates `core::num::pow` in favor of `Int::pow`.
Diffstat (limited to 'src/libstd/num')
| -rw-r--r-- | src/libstd/num/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/num/mod.rs b/src/libstd/num/mod.rs index 2ce6c0e6e71..f49b2b0deed 100644 --- a/src/libstd/num/mod.rs +++ b/src/libstd/num/mod.rs @@ -757,7 +757,7 @@ mod tests { } macro_rules! assert_pow( (($num:expr, $exp:expr) => $expected:expr) => {{ - let result = pow($num, $exp); + let result = $num.pow($exp); assert_eq!(result, $expected); assert_eq!(result, naive_pow($num, $exp)); }} @@ -775,12 +775,12 @@ mod tests { mod bench { extern crate test; use self::test::Bencher; - use num; + use num::Int; use prelude::*; #[bench] fn bench_pow_function(b: &mut Bencher) { let v = Vec::from_fn(1024u, |n| n); - b.iter(|| {v.iter().fold(0u, |old, new| num::pow(old, *new));}); + b.iter(|| {v.iter().fold(0u, |old, new| old.pow(*new));}); } } |
