about summary refs log tree commit diff
path: root/src/libcore/num
diff options
context:
space:
mode:
authorMarvin Löbel <loebel.marvin@gmail.com>2013-01-24 21:09:58 +0100
committerBrian Anderson <banderson@mozilla.com>2013-02-03 15:37:24 -0800
commitd13b23f37e014d1ac63e937e69d4d8b1ed7b68b0 (patch)
tree860ced4973959b0c7ded01f95f40bf12707bb4e5 /src/libcore/num
parent96f0512a45ffebbe7488332ec5e44827a14ce78d (diff)
downloadrust-d13b23f37e014d1ac63e937e69d4d8b1ed7b68b0.tar.gz
rust-d13b23f37e014d1ac63e937e69d4d8b1ed7b68b0.zip
Added ToStrRadix and FromStrRadix traits
Diffstat (limited to 'src/libcore/num')
-rw-r--r--src/libcore/num/num.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libcore/num/num.rs b/src/libcore/num/num.rs
index db8a741f185..5d26696f018 100644
--- a/src/libcore/num/num.rs
+++ b/src/libcore/num/num.rs
@@ -9,6 +9,8 @@
 // except according to those terms.
 
 //! An interface for numeric types
+use cmp::Eq;
+use option::{None, Option, Some};
 
 pub trait Num {
     // FIXME: Trait composition. (#2616)
@@ -50,3 +52,11 @@ pub enum RoundMode {
     RoundToZero,
     RoundFromZero
 }
+
+pub trait ToStrRadix {
+    pub pure fn to_str_radix(&self, radix: uint) -> ~str;
+}
+
+pub trait FromStrRadix {
+    static pub pure fn from_str_radix(str: &str, radix: uint) -> Option<self>;
+}
\ No newline at end of file