From d13b23f37e014d1ac63e937e69d4d8b1ed7b68b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marvin=20L=C3=B6bel?= Date: Thu, 24 Jan 2013 21:09:58 +0100 Subject: [PATCH] Added ToStrRadix and FromStrRadix traits --- src/libcore/num/num.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; +} \ No newline at end of file