Skip to content

Commit

Permalink
Update f16 doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Jul 12, 2024
1 parent 9dd7bb8 commit a06411d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions library/std/src/f16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1036,13 +1036,13 @@ impl f16 {
/// # #[cfg(not(bootstrap))]
/// # #[cfg(reliable_f16_math)] {
///
/// let x = 1e-8_f16;
/// let x = 1e-4_f16;
///
/// // for very small x, e^x is approximately 1 + x + x^2 / 2
/// let approx = x + x * x / 2.0;
/// let abs_difference = (x.exp_m1() - approx).abs();
///
/// assert!(abs_difference < 1e-10);
/// assert!(abs_difference < 1e-4);
/// # }
/// ```
#[inline]
Expand Down Expand Up @@ -1070,13 +1070,13 @@ impl f16 {
/// # #[cfg(not(bootstrap))]
/// # #[cfg(reliable_f16_math)] {
///
/// let x = 1e-8_f16;
/// let x = 1e-4_f16;
///
/// // for very small x, ln(1 + x) is approximately x - x^2 / 2
/// let approx = x - x * x / 2.0;
/// let abs_difference = (x.ln_1p() - approx).abs();
///
/// assert!(abs_difference < 1e-10);
/// assert!(abs_difference < 1e-4);
/// # }
/// ```
#[inline]
Expand Down Expand Up @@ -1282,7 +1282,7 @@ impl f16 {
///
/// let abs_difference = (f - e).abs();
///
/// assert!(abs_difference <= 1e-5);
/// assert!(abs_difference <= 0.01);
/// # }
/// ```
#[inline]
Expand Down

0 comments on commit a06411d

Please sign in to comment.