libcore: add num::Int::pow() and deprecate num::pow().

Signed-off-by: NODA, Kai <nodakai@gmail.com>
This commit is contained in:
NODA, Kai 2014-11-17 22:12:54 +08:00
parent 803aacd5ae
commit 3fcf2840a4
4 changed files with 33 additions and 28 deletions

View file

@ -93,8 +93,8 @@ fn main() {
let long_lived_tree = bottom_up_tree(&long_lived_arena, 0, max_depth);
let mut messages = range_step(min_depth, max_depth + 1, 2).map(|depth| {
use std::num::pow;
let iterations = pow(2i, (max_depth - depth + min_depth) as uint);
use std::num::Int;
let iterations = 2i.pow((max_depth - depth + min_depth) as uint);
Future::spawn(proc() {
let mut chk = 0;
for i in range(1, iterations + 1) {

View file

@ -14,7 +14,7 @@
extern crate libc;
use std::num;
use std::num::Int;
struct Foo {
x: uint,
@ -23,7 +23,7 @@ struct Foo {
}
fn field_read(f: Foo) -> uint {
num::pow(f.x, 2)
f.x.pow(2)
}
enum XYZ {