Skip to content

Commit 1cdc6e3

Browse files
tgross35gitbot
authored and
gitbot
committed
Add references to the IEEE functions for float_next_up_down
Mention the IEEE function by name and create a doc alias of the same.
1 parent 746de56 commit 1cdc6e3

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

core/src/num/f128.rs

+6
Original file line numberDiff line numberDiff line change
@@ -515,11 +515,14 @@ impl f128 {
515515
/// # }
516516
/// ```
517517
///
518+
/// This operation corresponds to IEEE-754 `nextUp`.
519+
///
518520
/// [`NEG_INFINITY`]: Self::NEG_INFINITY
519521
/// [`INFINITY`]: Self::INFINITY
520522
/// [`MIN`]: Self::MIN
521523
/// [`MAX`]: Self::MAX
522524
#[inline]
525+
#[doc(alias = "nextUp")]
523526
#[unstable(feature = "f128", issue = "116909")]
524527
pub const fn next_up(self) -> Self {
525528
// Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing
@@ -567,11 +570,14 @@ impl f128 {
567570
/// # }
568571
/// ```
569572
///
573+
/// This operation corresponds to IEEE-754 `nextDown`.
574+
///
570575
/// [`NEG_INFINITY`]: Self::NEG_INFINITY
571576
/// [`INFINITY`]: Self::INFINITY
572577
/// [`MIN`]: Self::MIN
573578
/// [`MAX`]: Self::MAX
574579
#[inline]
580+
#[doc(alias = "nextDown")]
575581
#[unstable(feature = "f128", issue = "116909")]
576582
pub const fn next_down(self) -> Self {
577583
// Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing

core/src/num/f16.rs

+6
Original file line numberDiff line numberDiff line change
@@ -508,11 +508,14 @@ impl f16 {
508508
/// # }
509509
/// ```
510510
///
511+
/// This operation corresponds to IEEE-754 `nextUp`.
512+
///
511513
/// [`NEG_INFINITY`]: Self::NEG_INFINITY
512514
/// [`INFINITY`]: Self::INFINITY
513515
/// [`MIN`]: Self::MIN
514516
/// [`MAX`]: Self::MAX
515517
#[inline]
518+
#[doc(alias = "nextUp")]
516519
#[unstable(feature = "f16", issue = "116909")]
517520
pub const fn next_up(self) -> Self {
518521
// Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing
@@ -560,11 +563,14 @@ impl f16 {
560563
/// # }
561564
/// ```
562565
///
566+
/// This operation corresponds to IEEE-754 `nextDown`.
567+
///
563568
/// [`NEG_INFINITY`]: Self::NEG_INFINITY
564569
/// [`INFINITY`]: Self::INFINITY
565570
/// [`MIN`]: Self::MIN
566571
/// [`MAX`]: Self::MAX
567572
#[inline]
573+
#[doc(alias = "nextDown")]
568574
#[unstable(feature = "f16", issue = "116909")]
569575
pub const fn next_down(self) -> Self {
570576
// Some targets violate Rust's assumption of IEEE semantics, e.g. by flushing

core/src/num/f32.rs

+6
Original file line numberDiff line numberDiff line change
@@ -733,11 +733,14 @@ impl f32 {
733733
/// assert_eq!(16777216f32.next_up(), 16777218.0);
734734
/// ```
735735
///
736+
/// This operation corresponds to IEEE-754 `nextUp`.
737+
///
736738
/// [`NEG_INFINITY`]: Self::NEG_INFINITY
737739
/// [`INFINITY`]: Self::INFINITY
738740
/// [`MIN`]: Self::MIN
739741
/// [`MAX`]: Self::MAX
740742
#[inline]
743+
#[doc(alias = "nextUp")]
741744
#[stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")]
742745
#[rustc_const_stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")]
743746
pub const fn next_up(self) -> Self {
@@ -781,11 +784,14 @@ impl f32 {
781784
/// assert_eq!(clamped.next_up(), 1.0);
782785
/// ```
783786
///
787+
/// This operation corresponds to IEEE-754 `nextDown`.
788+
///
784789
/// [`NEG_INFINITY`]: Self::NEG_INFINITY
785790
/// [`INFINITY`]: Self::INFINITY
786791
/// [`MIN`]: Self::MIN
787792
/// [`MAX`]: Self::MAX
788793
#[inline]
794+
#[doc(alias = "nextDown")]
789795
#[stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")]
790796
#[rustc_const_stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")]
791797
pub const fn next_down(self) -> Self {

core/src/num/f64.rs

+6
Original file line numberDiff line numberDiff line change
@@ -750,11 +750,14 @@ impl f64 {
750750
/// assert_eq!(9007199254740992f64.next_up(), 9007199254740994.0);
751751
/// ```
752752
///
753+
/// This operation corresponds to IEEE-754 `nextUp`.
754+
///
753755
/// [`NEG_INFINITY`]: Self::NEG_INFINITY
754756
/// [`INFINITY`]: Self::INFINITY
755757
/// [`MIN`]: Self::MIN
756758
/// [`MAX`]: Self::MAX
757759
#[inline]
760+
#[doc(alias = "nextUp")]
758761
#[stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")]
759762
#[rustc_const_stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")]
760763
pub const fn next_up(self) -> Self {
@@ -798,11 +801,14 @@ impl f64 {
798801
/// assert_eq!(clamped.next_up(), 1.0);
799802
/// ```
800803
///
804+
/// This operation corresponds to IEEE-754 `nextDown`.
805+
///
801806
/// [`NEG_INFINITY`]: Self::NEG_INFINITY
802807
/// [`INFINITY`]: Self::INFINITY
803808
/// [`MIN`]: Self::MIN
804809
/// [`MAX`]: Self::MAX
805810
#[inline]
811+
#[doc(alias = "nextDown")]
806812
#[stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")]
807813
#[rustc_const_stable(feature = "float_next_up_down", since = "CURRENT_RUSTC_VERSION")]
808814
pub const fn next_down(self) -> Self {

0 commit comments

Comments
 (0)