@@ -236,7 +236,7 @@ impl f32 {
236
236
/// let b = 60.0_f32;
237
237
///
238
238
/// // 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();
240
240
///
241
241
/// assert!(abs_difference <= f32::EPSILON);
242
242
/// ```
@@ -318,7 +318,7 @@ impl f32 {
318
318
/// use std::f32;
319
319
///
320
320
/// 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();
322
322
///
323
323
/// assert!(abs_difference <= f32::EPSILON);
324
324
/// ```
@@ -336,7 +336,7 @@ impl f32 {
336
336
/// use std::f32;
337
337
///
338
338
/// 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();
340
340
///
341
341
/// assert!(abs_difference <= f32::EPSILON);
342
342
/// ```
@@ -623,7 +623,7 @@ impl f32 {
623
623
/// ```
624
624
/// use std::f32;
625
625
///
626
- /// let x = 2.0* f32::consts::PI;
626
+ /// let x = 2.0 * f32::consts::PI;
627
627
///
628
628
/// let abs_difference = (x.cos() - 1.0).abs();
629
629
///
@@ -745,8 +745,8 @@ impl f32 {
745
745
/// let x2 = -3.0f32;
746
746
/// let y2 = 3.0f32;
747
747
///
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();
750
750
///
751
751
/// assert!(abs_difference_1 <= f32::EPSILON);
752
752
/// assert!(abs_difference_2 <= f32::EPSILON);
@@ -834,7 +834,7 @@ impl f32 {
834
834
///
835
835
/// let f = x.sinh();
836
836
/// // 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);
838
838
/// let abs_difference = (f - g).abs();
839
839
///
840
840
/// assert!(abs_difference <= f32::EPSILON);
@@ -856,7 +856,7 @@ impl f32 {
856
856
/// let x = 1.0f32;
857
857
/// let f = x.cosh();
858
858
/// // 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);
860
860
/// let abs_difference = (f - g).abs();
861
861
///
862
862
/// // Same result
@@ -880,7 +880,7 @@ impl f32 {
880
880
///
881
881
/// let f = x.tanh();
882
882
/// // 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));
884
884
/// let abs_difference = (f - g).abs();
885
885
///
886
886
/// assert!(abs_difference <= f32::EPSILON);
0 commit comments