Fix doc tests.
This commit is contained in:
parent
ce3badca57
commit
5d6933f34a
|
@ -8,12 +8,11 @@ pub trait Inv {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use num_traits::{Inv, One};
|
||||
/// use std::f64::INFINITY;
|
||||
/// use num_traits::Inv;
|
||||
///
|
||||
/// let x = 7.0;
|
||||
/// let y = -0.0;
|
||||
/// assert_eq!(x.inv() * x, One::one());
|
||||
/// assert_eq!(y.inv() * y, One::one());
|
||||
/// assert_eq!(7.0.inv() * 7.0, 1.0);
|
||||
/// assert_eq!((-0.0).inv(), -INFINITY);
|
||||
/// ```
|
||||
fn inv(self) -> Self::Output;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ pub trait Pow<RHS> {
|
|||
///
|
||||
/// ```
|
||||
/// use num_traits::Pow;
|
||||
/// assert_eq!(10.pow(2), 100);
|
||||
/// assert_eq!(Pow::pow(10u32, 2u32), 100);
|
||||
/// ```
|
||||
fn pow(self, rhs: RHS) -> Self::Output;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue