Skip to content

Commit 274960b

Browse files
committed
---
yaml --- r: 60446 b: refs/heads/auto c: 916942d h: refs/heads/master v: v3
1 parent e59e142 commit 274960b

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: c34c5051a5f42726d34dd09b7bf0ae120800a2d4
17+
refs/heads/auto: 916942d006ce3a551505b7b0328a82b382249b7c
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/src/libcore/num/num.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -396,16 +396,15 @@ pub trait FromStrRadix {
396396
/// - If code written to use this function doesn't care about it, it's
397397
/// probably assuming that `x^0` always equals `1`.
398398
///
399-
pub fn pow_with_uint<T:NumCast+One+Zero+Copy+Div<T,T>+Mul<T,T>>(
400-
radix: uint, pow: uint) -> T {
399+
pub fn pow_with_uint<T:NumCast+One+Zero+Copy+Div<T,T>+Mul<T,T>>(radix: uint, pow: uint) -> T {
401400
let _0: T = Zero::zero();
402401
let _1: T = One::one();
403402

404403
if pow == 0u { return _1; }
405404
if radix == 0u { return _0; }
406405
let mut my_pow = pow;
407406
let mut total = _1;
408-
let mut multiplier = cast(radix as int);
407+
let mut multiplier = cast(radix);
409408
while (my_pow > 0u) {
410409
if my_pow % 2u == 1u {
411410
total *= multiplier;
@@ -422,13 +421,13 @@ pub fn test_num<T:Num + NumCast>(ten: T, two: T) {
422421
assert_eq!(ten.add(&two), cast(12));
423422
assert_eq!(ten.sub(&two), cast(8));
424423
assert_eq!(ten.mul(&two), cast(20));
425-
assert_eq!(ten.div(&two), cast(5));
424+
assert_eq!(ten.div(&two), cast(5));
426425
assert_eq!(ten.rem(&two), cast(0));
427426

428427
assert_eq!(ten.add(&two), ten + two);
429428
assert_eq!(ten.sub(&two), ten - two);
430429
assert_eq!(ten.mul(&two), ten * two);
431-
assert_eq!(ten.div(&two), ten / two);
430+
assert_eq!(ten.div(&two), ten / two);
432431
assert_eq!(ten.rem(&two), ten % two);
433432
}
434433

0 commit comments

Comments
 (0)