mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Added ToStrRadix and FromStrRadix traits
This commit is contained in:
parent
96f0512a45
commit
d13b23f37e
@ -9,6 +9,8 @@
|
|||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
//! An interface for numeric types
|
//! An interface for numeric types
|
||||||
|
use cmp::Eq;
|
||||||
|
use option::{None, Option, Some};
|
||||||
|
|
||||||
pub trait Num {
|
pub trait Num {
|
||||||
// FIXME: Trait composition. (#2616)
|
// FIXME: Trait composition. (#2616)
|
||||||
@ -50,3 +52,11 @@ pub enum RoundMode {
|
|||||||
RoundToZero,
|
RoundToZero,
|
||||||
RoundFromZero
|
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…
Reference in New Issue
Block a user