about summary refs log tree commit diff
path: root/src/libstd/num
diff options
context:
space:
mode:
authorBrendan Zabarauskas <bjzaba@yahoo.com.au>2014-11-10 11:30:52 +1100
committerBrendan Zabarauskas <bjzaba@yahoo.com.au>2014-11-13 02:04:31 +1100
commit26196715e8e8fb3a578cc89a54c13773dc1a3772 (patch)
treedacc46c9de707a55d2520bfd9eb7f54320194be5 /src/libstd/num
parent46333d527b138e8e202380a5ce4409dfe1414148 (diff)
downloadrust-26196715e8e8fb3a578cc89a54c13773dc1a3772.tar.gz
rust-26196715e8e8fb3a578cc89a54c13773dc1a3772.zip
Deprecate Num, Unsigned and Primitive
Diffstat (limited to 'src/libstd/num')
-rw-r--r--src/libstd/num/mod.rs2
-rw-r--r--src/libstd/num/strconv.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/num/mod.rs b/src/libstd/num/mod.rs
index f831de88858..28fe7538ca5 100644
--- a/src/libstd/num/mod.rs
+++ b/src/libstd/num/mod.rs
@@ -135,7 +135,7 @@ pub fn abs_sub<T: FloatMath>(x: T, y: T) -> T {
 
 /// Helper function for testing numeric operations
 #[cfg(test)]
-pub fn test_num<T:Num + NumCast + Show>(ten: T, two: T) {
+pub fn test_num<T: Int + Show>(ten: T, two: T) {
     assert_eq!(ten.add(&two),  cast(12i).unwrap());
     assert_eq!(ten.sub(&two),  cast(8i).unwrap());
     assert_eq!(ten.mul(&two),  cast(20i).unwrap());
diff --git a/src/libstd/num/strconv.rs b/src/libstd/num/strconv.rs
index 7c21b020647..06d2f0ef028 100644
--- a/src/libstd/num/strconv.rs
+++ b/src/libstd/num/strconv.rs
@@ -116,7 +116,7 @@ fn int_to_str_bytes_common<T: Int>(num: T, radix: uint, sign: SignFormat, f: |u8
         // numbers [-35 .. 0] we always have [0 .. 35].
         let current_digit_signed = deccum % radix_gen;
         let current_digit = if current_digit_signed < _0 {
-            -current_digit_signed
+            _0 - current_digit_signed
         } else {
             current_digit_signed
         };