|
@@ -677,14 +677,6 @@ pub trait PrimInt
|
|
|
macro_rules! prim_int_impl {
|
|
|
($($T:ty)*) => ($(
|
|
|
impl PrimInt for $T {
|
|
|
- fn min_value() -> Self {
|
|
|
- <$T>::min_value()
|
|
|
- }
|
|
|
-
|
|
|
- fn max_value() -> Self {
|
|
|
- <$T>::max_value()
|
|
|
- }
|
|
|
-
|
|
|
fn count_ones(self) -> u32 {
|
|
|
<$T>::count_ones(self)
|
|
|
}
|
|
@@ -736,6 +728,8 @@ macro_rules! prim_int_impl {
|
|
|
)*)
|
|
|
}
|
|
|
|
|
|
+prim_int_impl!(u8 u16 u32 u64 usize i8 i16 i32 i64 isize);
|
|
|
+
|
|
|
/// A generic trait for converting a value to a number.
|
|
|
pub trait ToPrimitive {
|
|
|
/// Converts the value of `self` to an `isize`.
|
|
@@ -1329,8 +1323,8 @@ pub trait Float
|
|
|
/// predicate instead.
|
|
|
///
|
|
|
/// ```
|
|
|
- /// # #![feature(core)]
|
|
|
- /// use std::num::{Float, FpCategory};
|
|
|
+ /// use num::traits::Float;
|
|
|
+ /// use std::num::FpCategory;
|
|
|
/// use std::f32;
|
|
|
///
|
|
|
/// let num = 12.4f32;
|
|
@@ -1880,7 +1874,6 @@ pub trait Float
|
|
|
/// the operations were performed separately.
|
|
|
///
|
|
|
/// ```
|
|
|
- /// # #![feature(std_misc, core)]
|
|
|
/// use num::traits::Float;
|
|
|
/// use std::f64;
|
|
|
///
|