Skip to content

Commit 0ba1c10

Browse files
committed
1 parent 8ff4b42 commit 0ba1c10

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/libstd/f32.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,10 @@ impl f32 {
195195
}
196196

197197
/// Fused multiply-add. Computes `(self * a) + b` with only one rounding
198-
/// error. This produces a more accurate result with better performance than
199-
/// a separate multiplication operation followed by an add.
198+
/// error, yielding a more accurate result than an unfused multiply-add.
199+
///
200+
/// Using `mul_add` can be more performant than an unfused multiply-add if
201+
/// the target architecture has a dedicated `fma` CPU instruction.
200202
///
201203
/// ```
202204
/// use std::f32;

src/libstd/f64.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,10 @@ impl f64 {
173173
}
174174

175175
/// Fused multiply-add. Computes `(self * a) + b` with only one rounding
176-
/// error. This produces a more accurate result with better performance than
177-
/// a separate multiplication operation followed by an add.
176+
/// error, yielding a more accurate result than an unfused multiply-add.
177+
///
178+
/// Using `mul_add` can be more performant than an unfused multiply-add if
179+
/// the target architecture has a dedicated `fma` CPU instruction.
178180
///
179181
/// ```
180182
/// let m = 10.0_f64;

0 commit comments

Comments
 (0)