Skip to content

Commit 3b04e91

Browse files
Change code formatting for readability.
1 parent 49dce29 commit 3b04e91

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

src/libcore/num/f32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ impl f32 {
315315
/// use std::f32;
316316
///
317317
/// let x = 2.0_f32;
318-
/// let abs_difference = (x.recip() - (1.0/x)).abs();
318+
/// let abs_difference = (x.recip() - (1.0 / x)).abs();
319319
///
320320
/// assert!(abs_difference <= f32::EPSILON);
321321
/// ```

src/libcore/num/f64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ impl f64 {
327327
///
328328
/// ```
329329
/// let x = 2.0_f64;
330-
/// let abs_difference = (x.recip() - (1.0/x)).abs();
330+
/// let abs_difference = (x.recip() - (1.0 / x)).abs();
331331
///
332332
/// assert!(abs_difference < 1e-10);
333333
/// ```

src/libstd/f32.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ impl f32 {
236236
/// let b = 60.0_f32;
237237
///
238238
/// // 100.0
239-
/// let abs_difference = (m.mul_add(x, b) - (m*x + b)).abs();
239+
/// let abs_difference = (m.mul_add(x, b) - ((m * x) + b)).abs();
240240
///
241241
/// assert!(abs_difference <= f32::EPSILON);
242242
/// ```
@@ -318,7 +318,7 @@ impl f32 {
318318
/// use std::f32;
319319
///
320320
/// let x = 2.0_f32;
321-
/// let abs_difference = (x.powi(2) - x*x).abs();
321+
/// let abs_difference = (x.powi(2) - (x * x)).abs();
322322
///
323323
/// assert!(abs_difference <= f32::EPSILON);
324324
/// ```
@@ -336,7 +336,7 @@ impl f32 {
336336
/// use std::f32;
337337
///
338338
/// let x = 2.0_f32;
339-
/// let abs_difference = (x.powf(2.0) - x*x).abs();
339+
/// let abs_difference = (x.powf(2.0) - (x * x)).abs();
340340
///
341341
/// assert!(abs_difference <= f32::EPSILON);
342342
/// ```
@@ -623,7 +623,7 @@ impl f32 {
623623
/// ```
624624
/// use std::f32;
625625
///
626-
/// let x = 2.0*f32::consts::PI;
626+
/// let x = 2.0 * f32::consts::PI;
627627
///
628628
/// let abs_difference = (x.cos() - 1.0).abs();
629629
///
@@ -745,8 +745,8 @@ impl f32 {
745745
/// let x2 = -3.0f32;
746746
/// let y2 = 3.0f32;
747747
///
748-
/// let abs_difference_1 = (y1.atan2(x1) - (-pi/4.0)).abs();
749-
/// let abs_difference_2 = (y2.atan2(x2) - 3.0*pi/4.0).abs();
748+
/// let abs_difference_1 = (y1.atan2(x1) - (-pi / 4.0)).abs();
749+
/// let abs_difference_2 = (y2.atan2(x2) - (3.0 * pi / 4.0)).abs();
750750
///
751751
/// assert!(abs_difference_1 <= f32::EPSILON);
752752
/// assert!(abs_difference_2 <= f32::EPSILON);
@@ -834,7 +834,7 @@ impl f32 {
834834
///
835835
/// let f = x.sinh();
836836
/// // Solving sinh() at 1 gives `(e^2-1)/(2e)`
837-
/// let g = (e*e - 1.0)/(2.0*e);
837+
/// let g = ((e * e) - 1.0) / (2.0 * e);
838838
/// let abs_difference = (f - g).abs();
839839
///
840840
/// assert!(abs_difference <= f32::EPSILON);
@@ -856,7 +856,7 @@ impl f32 {
856856
/// let x = 1.0f32;
857857
/// let f = x.cosh();
858858
/// // Solving cosh() at 1 gives this result
859-
/// let g = (e*e + 1.0)/(2.0*e);
859+
/// let g = ((e * e) + 1.0) / (2.0 * e);
860860
/// let abs_difference = (f - g).abs();
861861
///
862862
/// // Same result
@@ -880,7 +880,7 @@ impl f32 {
880880
///
881881
/// let f = x.tanh();
882882
/// // Solving tanh() at 1 gives `(1 - e^(-2))/(1 + e^(-2))`
883-
/// let g = (1.0 - e.powi(-2))/(1.0 + e.powi(-2));
883+
/// let g = (1.0 - e.powi(-2)) / (1.0 + e.powi(-2));
884884
/// let abs_difference = (f - g).abs();
885885
///
886886
/// assert!(abs_difference <= f32::EPSILON);

src/libstd/f64.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ impl f64 {
212212
/// let b = 60.0_f64;
213213
///
214214
/// // 100.0
215-
/// let abs_difference = (m.mul_add(x, b) - (m*x + b)).abs();
215+
/// let abs_difference = (m.mul_add(x, b) - ((m * x) + b)).abs();
216216
///
217217
/// assert!(abs_difference < 1e-10);
218218
/// ```
@@ -291,7 +291,7 @@ impl f64 {
291291
///
292292
/// ```
293293
/// let x = 2.0_f64;
294-
/// let abs_difference = (x.powi(2) - x*x).abs();
294+
/// let abs_difference = (x.powi(2) - (x * x)).abs();
295295
///
296296
/// assert!(abs_difference < 1e-10);
297297
/// ```
@@ -307,7 +307,7 @@ impl f64 {
307307
///
308308
/// ```
309309
/// let x = 2.0_f64;
310-
/// let abs_difference = (x.powf(2.0) - x*x).abs();
310+
/// let abs_difference = (x.powf(2.0) - (x * x)).abs();
311311
///
312312
/// assert!(abs_difference < 1e-10);
313313
/// ```
@@ -556,7 +556,7 @@ impl f64 {
556556
/// ```
557557
/// use std::f64;
558558
///
559-
/// let x = 2.0*f64::consts::PI;
559+
/// let x = 2.0 * f64::consts::PI;
560560
///
561561
/// let abs_difference = (x.cos() - 1.0).abs();
562562
///
@@ -672,8 +672,8 @@ impl f64 {
672672
/// let x2 = -3.0_f64;
673673
/// let y2 = 3.0_f64;
674674
///
675-
/// let abs_difference_1 = (y1.atan2(x1) - (-pi/4.0)).abs();
676-
/// let abs_difference_2 = (y2.atan2(x2) - 3.0*pi/4.0).abs();
675+
/// let abs_difference_1 = (y1.atan2(x1) - (-pi / 4.0)).abs();
676+
/// let abs_difference_2 = (y2.atan2(x2) - (3.0 * pi / 4.0)).abs();
677677
///
678678
/// assert!(abs_difference_1 < 1e-10);
679679
/// assert!(abs_difference_2 < 1e-10);
@@ -759,7 +759,7 @@ impl f64 {
759759
///
760760
/// let f = x.sinh();
761761
/// // Solving sinh() at 1 gives `(e^2-1)/(2e)`
762-
/// let g = (e*e - 1.0)/(2.0*e);
762+
/// let g = ((e * e) - 1.0) / (2.0 * e);
763763
/// let abs_difference = (f - g).abs();
764764
///
765765
/// assert!(abs_difference < 1e-10);
@@ -781,7 +781,7 @@ impl f64 {
781781
/// let x = 1.0_f64;
782782
/// let f = x.cosh();
783783
/// // Solving cosh() at 1 gives this result
784-
/// let g = (e*e + 1.0)/(2.0*e);
784+
/// let g = ((e * e) + 1.0) / (2.0 * e);
785785
/// let abs_difference = (f - g).abs();
786786
///
787787
/// // Same result
@@ -805,7 +805,7 @@ impl f64 {
805805
///
806806
/// let f = x.tanh();
807807
/// // Solving tanh() at 1 gives `(1 - e^(-2))/(1 + e^(-2))`
808-
/// let g = (1.0 - e.powi(-2))/(1.0 + e.powi(-2));
808+
/// let g = (1.0 - e.powi(-2)) / (1.0 + e.powi(-2));
809809
/// let abs_difference = (f - g).abs();
810810
///
811811
/// assert!(abs_difference < 1.0e-10);

0 commit comments

Comments
 (0)