Skip to content

Commit b58cbf2

Browse files
tgross35gitbot
authored and
gitbot
committed
Add doc aliases for libm and IEEE names
Searching "fma" in the Rust documentation returns results for `intrinsics::fma*`, but does not point to the user-facing `mul_add`. Add aliases for `fma*` and the IEEE operation name `fusedMultiplyAdd`. Add the IEEE name to `sqrt` as well, `squareRoot`.
1 parent 9a83e13 commit b58cbf2

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

std/src/f128.rs

+2
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ impl f128 {
227227
/// ```
228228
#[inline]
229229
#[rustc_allow_incoherent_impl]
230+
#[doc(alias = "fmaf128", alias = "fusedMultiplyAdd")]
230231
#[unstable(feature = "f128", issue = "116909")]
231232
#[must_use = "method returns a new number and does not mutate the original value"]
232233
pub fn mul_add(self, a: f128, b: f128) -> f128 {
@@ -384,6 +385,7 @@ impl f128 {
384385
/// # }
385386
/// ```
386387
#[inline]
388+
#[doc(alias = "squareRoot")]
387389
#[rustc_allow_incoherent_impl]
388390
#[unstable(feature = "f128", issue = "116909")]
389391
#[must_use = "method returns a new number and does not mutate the original value"]

std/src/f16.rs

+2
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ impl f16 {
228228
#[inline]
229229
#[rustc_allow_incoherent_impl]
230230
#[unstable(feature = "f16", issue = "116909")]
231+
#[doc(alias = "fmaf16", alias = "fusedMultiplyAdd")]
231232
#[must_use = "method returns a new number and does not mutate the original value"]
232233
pub fn mul_add(self, a: f16, b: f16) -> f16 {
233234
unsafe { intrinsics::fmaf16(self, a, b) }
@@ -384,6 +385,7 @@ impl f16 {
384385
/// # }
385386
/// ```
386387
#[inline]
388+
#[doc(alias = "squareRoot")]
387389
#[rustc_allow_incoherent_impl]
388390
#[unstable(feature = "f16", issue = "116909")]
389391
#[must_use = "method returns a new number and does not mutate the original value"]

std/src/f32.rs

+2
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ impl f32 {
210210
/// assert_eq!(one_plus_eps * one_minus_eps + minus_one, 0.0);
211211
/// ```
212212
#[rustc_allow_incoherent_impl]
213+
#[doc(alias = "fmaf", alias = "fusedMultiplyAdd")]
213214
#[must_use = "method returns a new number and does not mutate the original value"]
214215
#[stable(feature = "rust1", since = "1.0.0")]
215216
#[inline]
@@ -360,6 +361,7 @@ impl f32 {
360361
/// assert!(negative.sqrt().is_nan());
361362
/// assert!(negative_zero.sqrt() == negative_zero);
362363
/// ```
364+
#[doc(alias = "squareRoot")]
363365
#[rustc_allow_incoherent_impl]
364366
#[must_use = "method returns a new number and does not mutate the original value"]
365367
#[stable(feature = "rust1", since = "1.0.0")]

std/src/f64.rs

+2
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ impl f64 {
210210
/// assert_eq!(one_plus_eps * one_minus_eps + minus_one, 0.0);
211211
/// ```
212212
#[rustc_allow_incoherent_impl]
213+
#[doc(alias = "fma", alias = "fusedMultiplyAdd")]
213214
#[must_use = "method returns a new number and does not mutate the original value"]
214215
#[stable(feature = "rust1", since = "1.0.0")]
215216
#[inline]
@@ -360,6 +361,7 @@ impl f64 {
360361
/// assert!(negative.sqrt().is_nan());
361362
/// assert!(negative_zero.sqrt() == negative_zero);
362363
/// ```
364+
#[doc(alias = "squareRoot")]
363365
#[rustc_allow_incoherent_impl]
364366
#[must_use = "method returns a new number and does not mutate the original value"]
365367
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)