Skip to content

Commit 296e60b

Browse files
committed
auto merge of #13470 : Manishearth/rust/docnum, r=brson
See #7511
2 parents 465109d + 01d5d51 commit 296e60b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libstd/num/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ pub fn abs_sub<T: Signed>(x: T, y: T) -> T {
159159
/// - `-1` if the number is negative
160160
#[inline(always)] pub fn signum<T: Signed>(value: T) -> T { value.signum() }
161161

162+
/// A trait for values which cannot be negative
162163
pub trait Unsigned: Num {}
163164

164165
/// A collection of rounding operations.
@@ -205,6 +206,7 @@ pub fn pow<T: One + Mul<T, T>>(mut base: T, mut exp: uint) -> T {
205206
}
206207
}
207208

209+
/// Numbers which have upper and lower bounds
208210
pub trait Bounded {
209211
// FIXME (#5527): These should be associated constants
210212
fn min_value() -> Self;
@@ -1046,10 +1048,12 @@ impl_num_cast!(int, to_int)
10461048
impl_num_cast!(f32, to_f32)
10471049
impl_num_cast!(f64, to_f64)
10481050

1051+
/// A generic trait for converting a value to a string with a radix (base)
10491052
pub trait ToStrRadix {
10501053
fn to_str_radix(&self, radix: uint) -> ~str;
10511054
}
10521055

1056+
/// A generic trait for converting a string with a radix (base) to a value
10531057
pub trait FromStrRadix {
10541058
fn from_str_radix(str: &str, radix: uint) -> Option<Self>;
10551059
}

0 commit comments

Comments
 (0)