Added ToStrRadix and FromStrRadix traits

This commit is contained in:
Marvin Löbel 2013-01-24 21:09:58 +01:00 committed by Brian Anderson
parent 96f0512a45
commit d13b23f37e

View File

@ -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>;
}