/// // Values between `0` and `min` are Subnormal.
/// assert!(!lower_than_min.is_normal());
/// ```
- /// [subnormal]: http://en.wikipedia.org/wiki/Denormal_number
+ /// [subnormal]: https://en.wikipedia.org/wiki/Denormal_number
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn is_normal(self) -> bool { num::Float::is_normal(self) }
/// Computes the tangent of a number (in radians).
///
/// ```
- /// use std::f64;
+ /// use std::f32;
///
- /// let x = f64::consts::PI/4.0;
+ /// let x = f32::consts::PI / 4.0;
/// let abs_difference = (x.tan() - 1.0).abs();
///
- /// assert!(abs_difference < 1e-10);
+ /// assert!(abs_difference <= f32::EPSILON);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
/// number is close to zero.
///
/// ```
- /// let x = 7.0f64;
+ /// use std::f32;
///
- /// // e^(ln(7)) - 1
- /// let abs_difference = (x.ln().exp_m1() - 6.0).abs();
+ /// let x = 6.0f32;
///
- /// assert!(abs_difference < 1e-10);
+ /// // e^(ln(6)) - 1
+ /// let abs_difference = (x.ln().exp_m1() - 5.0).abs();
+ ///
+ /// assert!(abs_difference <= f32::EPSILON);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
/// [subnormal][subnormal], or `NaN`.
///
/// ```
- /// use std::f32;
+ /// use std::f64;
///
- /// let min = f32::MIN_POSITIVE; // 1.17549435e-38f64
- /// let max = f32::MAX;
- /// let lower_than_min = 1.0e-40_f32;
- /// let zero = 0.0f32;
+ /// let min = f64::MIN_POSITIVE; // 2.2250738585072014e-308f64
+ /// let max = f64::MAX;
+ /// let lower_than_min = 1.0e-308_f64;
+ /// let zero = 0.0f64;
///
/// assert!(min.is_normal());
/// assert!(max.is_normal());
///
/// assert!(!zero.is_normal());
- /// assert!(!f32::NAN.is_normal());
- /// assert!(!f32::INFINITY.is_normal());
+ /// assert!(!f64::NAN.is_normal());
+ /// assert!(!f64::INFINITY.is_normal());
/// // Values between `0` and `min` are Subnormal.
/// assert!(!lower_than_min.is_normal());
/// ```
- /// [subnormal]: http://en.wikipedia.org/wiki/Denormal_number
+ /// [subnormal]: https://en.wikipedia.org/wiki/Denormal_number
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn is_normal(self) -> bool { num::Float::is_normal(self) }
/// ```
/// #![feature(float_extras)]
///
- /// let x = 1.0f32;
+ /// let x = 1.0f64;
///
- /// let abs_diff = (x.next_after(2.0) - 1.00000011920928955078125_f32).abs();
+ /// let abs_diff = (x.next_after(2.0) - 1.0000000000000002220446049250313_f64).abs();
///
/// assert!(abs_diff < 1e-10);
/// ```
///
/// *[See also the `std::f32` module](f32/index.html).*
///
-/// However, please note that examples are shared between the `f64` and `f32`
-/// primitive types. So it's normal if you see usage of `f64` in there.
-///
mod prim_f32 { }
#[doc(primitive = "f64")]
///
/// *[See also the `std::f64` module](f64/index.html).*
///
-/// However, please note that examples are shared between the `f64` and `f32`
-/// primitive types. So it's normal if you see usage of `f32` in there.
-///
mod prim_f64 { }
#[doc(primitive = "i8")]