Skip to content

Commit f061737

Browse files
committed
Fix doctest.
1 parent 230032b commit f061737

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

library/core/src/primitive_docs.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,14 +1335,16 @@ mod prim_f16 {}
13351335
/// For example:
13361336
///
13371337
/// ```
1338-
/// x = x.algebraic_add(x, a.algebraic_mul(b));
1339-
/// ```
1338+
/// let x = 12.0;
1339+
/// let a = 34.0;
1340+
/// let b = 56.0;
13401341
///
1341-
/// May be rewritten as either:
1342+
/// // This:
1343+
/// let x = x.algebraic_add(x, a.algebraic_mul(b));
13421344
///
1343-
/// ```
1344-
/// x = x + (a * b); // As written
1345-
/// x = (a * b) + x; // Reordered to allow using a single `fma`
1345+
/// // May be rewritten as either:
1346+
/// let x = x + (a * b); // As written
1347+
/// let x = (a * b) + x; // Reordered to allow using a single `fma`
13461348
/// ```
13471349
13481350
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)