Added ToStrRadix and FromStrRadix traits
This commit is contained in:
parent
96f0512a45
commit
d13b23f37e
@ -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>;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user