Skip to content

Commit

Permalink
Change code formatting for readability.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasz-rozanski committed Aug 22, 2019
1 parent 49dce29 commit 3b04e91
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/libcore/num/f32.rs
Expand Up @@ -315,7 +315,7 @@ impl f32 {
/// use std::f32;
///
/// let x = 2.0_f32;
/// let abs_difference = (x.recip() - (1.0/x)).abs();
/// let abs_difference = (x.recip() - (1.0 / x)).abs();
///
/// assert!(abs_difference <= f32::EPSILON);
/// ```
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/num/f64.rs
Expand Up @@ -327,7 +327,7 @@ impl f64 {
///
/// ```
/// let x = 2.0_f64;
/// let abs_difference = (x.recip() - (1.0/x)).abs();
/// let abs_difference = (x.recip() - (1.0 / x)).abs();
///
/// assert!(abs_difference < 1e-10);
/// ```
Expand Down
18 changes: 9 additions & 9 deletions src/libstd/f32.rs
Expand Up @@ -236,7 +236,7 @@ impl f32 {
/// let b = 60.0_f32;
///
/// // 100.0
/// let abs_difference = (m.mul_add(x, b) - (m*x + b)).abs();
/// let abs_difference = (m.mul_add(x, b) - ((m * x) + b)).abs();
///
/// assert!(abs_difference <= f32::EPSILON);
/// ```
Expand Down Expand Up @@ -318,7 +318,7 @@ impl f32 {
/// use std::f32;
///
/// let x = 2.0_f32;
/// let abs_difference = (x.powi(2) - x*x).abs();
/// let abs_difference = (x.powi(2) - (x * x)).abs();
///
/// assert!(abs_difference <= f32::EPSILON);
/// ```
Expand All @@ -336,7 +336,7 @@ impl f32 {
/// use std::f32;
///
/// let x = 2.0_f32;
/// let abs_difference = (x.powf(2.0) - x*x).abs();
/// let abs_difference = (x.powf(2.0) - (x * x)).abs();
///
/// assert!(abs_difference <= f32::EPSILON);
/// ```
Expand Down Expand Up @@ -623,7 +623,7 @@ impl f32 {
/// ```
/// use std::f32;
///
/// let x = 2.0*f32::consts::PI;
/// let x = 2.0 * f32::consts::PI;
///
/// let abs_difference = (x.cos() - 1.0).abs();
///
Expand Down Expand Up @@ -745,8 +745,8 @@ impl f32 {
/// let x2 = -3.0f32;
/// let y2 = 3.0f32;
///
/// let abs_difference_1 = (y1.atan2(x1) - (-pi/4.0)).abs();
/// let abs_difference_2 = (y2.atan2(x2) - 3.0*pi/4.0).abs();
/// let abs_difference_1 = (y1.atan2(x1) - (-pi / 4.0)).abs();
/// let abs_difference_2 = (y2.atan2(x2) - (3.0 * pi / 4.0)).abs();
///
/// assert!(abs_difference_1 <= f32::EPSILON);
/// assert!(abs_difference_2 <= f32::EPSILON);
Expand Down Expand Up @@ -834,7 +834,7 @@ impl f32 {
///
/// let f = x.sinh();
/// // Solving sinh() at 1 gives `(e^2-1)/(2e)`
/// let g = (e*e - 1.0)/(2.0*e);
/// let g = ((e * e) - 1.0) / (2.0 * e);
/// let abs_difference = (f - g).abs();
///
/// assert!(abs_difference <= f32::EPSILON);
Expand All @@ -856,7 +856,7 @@ impl f32 {
/// let x = 1.0f32;
/// let f = x.cosh();
/// // Solving cosh() at 1 gives this result
/// let g = (e*e + 1.0)/(2.0*e);
/// let g = ((e * e) + 1.0) / (2.0 * e);
/// let abs_difference = (f - g).abs();
///
/// // Same result
Expand All @@ -880,7 +880,7 @@ impl f32 {
///
/// let f = x.tanh();
/// // Solving tanh() at 1 gives `(1 - e^(-2))/(1 + e^(-2))`
/// let g = (1.0 - e.powi(-2))/(1.0 + e.powi(-2));
/// let g = (1.0 - e.powi(-2)) / (1.0 + e.powi(-2));
/// let abs_difference = (f - g).abs();
///
/// assert!(abs_difference <= f32::EPSILON);
Expand Down
18 changes: 9 additions & 9 deletions src/libstd/f64.rs
Expand Up @@ -212,7 +212,7 @@ impl f64 {
/// let b = 60.0_f64;
///
/// // 100.0
/// let abs_difference = (m.mul_add(x, b) - (m*x + b)).abs();
/// let abs_difference = (m.mul_add(x, b) - ((m * x) + b)).abs();
///
/// assert!(abs_difference < 1e-10);
/// ```
Expand Down Expand Up @@ -291,7 +291,7 @@ impl f64 {
///
/// ```
/// let x = 2.0_f64;
/// let abs_difference = (x.powi(2) - x*x).abs();
/// let abs_difference = (x.powi(2) - (x * x)).abs();
///
/// assert!(abs_difference < 1e-10);
/// ```
Expand All @@ -307,7 +307,7 @@ impl f64 {
///
/// ```
/// let x = 2.0_f64;
/// let abs_difference = (x.powf(2.0) - x*x).abs();
/// let abs_difference = (x.powf(2.0) - (x * x)).abs();
///
/// assert!(abs_difference < 1e-10);
/// ```
Expand Down Expand Up @@ -556,7 +556,7 @@ impl f64 {
/// ```
/// use std::f64;
///
/// let x = 2.0*f64::consts::PI;
/// let x = 2.0 * f64::consts::PI;
///
/// let abs_difference = (x.cos() - 1.0).abs();
///
Expand Down Expand Up @@ -672,8 +672,8 @@ impl f64 {
/// let x2 = -3.0_f64;
/// let y2 = 3.0_f64;
///
/// let abs_difference_1 = (y1.atan2(x1) - (-pi/4.0)).abs();
/// let abs_difference_2 = (y2.atan2(x2) - 3.0*pi/4.0).abs();
/// let abs_difference_1 = (y1.atan2(x1) - (-pi / 4.0)).abs();
/// let abs_difference_2 = (y2.atan2(x2) - (3.0 * pi / 4.0)).abs();
///
/// assert!(abs_difference_1 < 1e-10);
/// assert!(abs_difference_2 < 1e-10);
Expand Down Expand Up @@ -759,7 +759,7 @@ impl f64 {
///
/// let f = x.sinh();
/// // Solving sinh() at 1 gives `(e^2-1)/(2e)`
/// let g = (e*e - 1.0)/(2.0*e);
/// let g = ((e * e) - 1.0) / (2.0 * e);
/// let abs_difference = (f - g).abs();
///
/// assert!(abs_difference < 1e-10);
Expand All @@ -781,7 +781,7 @@ impl f64 {
/// let x = 1.0_f64;
/// let f = x.cosh();
/// // Solving cosh() at 1 gives this result
/// let g = (e*e + 1.0)/(2.0*e);
/// let g = ((e * e) + 1.0) / (2.0 * e);
/// let abs_difference = (f - g).abs();
///
/// // Same result
Expand All @@ -805,7 +805,7 @@ impl f64 {
///
/// let f = x.tanh();
/// // Solving tanh() at 1 gives `(1 - e^(-2))/(1 + e^(-2))`
/// let g = (1.0 - e.powi(-2))/(1.0 + e.powi(-2));
/// let g = (1.0 - e.powi(-2)) / (1.0 + e.powi(-2));
/// let abs_difference = (f - g).abs();
///
/// assert!(abs_difference < 1.0e-10);
Expand Down

0 comments on commit 3b04e91

Please sign in to comment.