Skip to content

Commit 010da38

Browse files
authored
Rollup merge of #149395 - RalfJung:float-minimum, r=scottmcm
float::minimum/maximum: say which exact IEEE operation this corresponds to There's both `minimum` and `minimumNumber`, so this seems worth clarifying. Also use code font for these names to make it more clear that they are technical terms.
2 parents 888e5da + be22161 commit 010da38

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

library/core/src/num/f128.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -695,8 +695,8 @@ impl f128 {
695695
/// Returns the maximum of the two numbers, ignoring NaN.
696696
///
697697
/// If one of the arguments is NaN, then the other argument is returned.
698-
/// This follows the IEEE 754-2008 semantics for maxNum, except for handling of signaling NaNs;
699-
/// this function handles all NaNs the same way and avoids maxNum's problems with associativity.
698+
/// This follows the IEEE 754-2008 semantics for `maxNum`, except for handling of signaling NaNs;
699+
/// this function handles all NaNs the same way and avoids `maxNum`'s problems with associativity.
700700
/// This also matches the behavior of libm’s fmax. In particular, if the inputs compare equal
701701
/// (such as for the case of `+0.0` and `-0.0`), either input may be returned non-deterministically.
702702
///
@@ -723,8 +723,8 @@ impl f128 {
723723
/// Returns the minimum of the two numbers, ignoring NaN.
724724
///
725725
/// If one of the arguments is NaN, then the other argument is returned.
726-
/// This follows the IEEE 754-2008 semantics for minNum, except for handling of signaling NaNs;
727-
/// this function handles all NaNs the same way and avoids minNum's problems with associativity.
726+
/// This follows the IEEE 754-2008 semantics for `minNum`, except for handling of signaling NaNs;
727+
/// this function handles all NaNs the same way and avoids `minNum`'s problems with associativity.
728728
/// This also matches the behavior of libm’s fmin. In particular, if the inputs compare equal
729729
/// (such as for the case of `+0.0` and `-0.0`), either input may be returned non-deterministically.
730730
///
@@ -769,7 +769,7 @@ impl f128 {
769769
///
770770
/// If one of the arguments is NaN, then NaN is returned. Otherwise this returns the greater
771771
/// of the two numbers. For this operation, -0.0 is considered to be less than +0.0.
772-
/// Note that this follows the semantics specified in IEEE 754-2019.
772+
/// Note that this follows the IEEE 754-2019 semantics for `maximum`.
773773
///
774774
/// Also note that "propagation" of NaNs here doesn't necessarily mean that the bitpattern of a NaN
775775
/// operand is conserved; see the [specification of NaN bit patterns](f32#nan-bit-patterns) for more info.
@@ -802,7 +802,7 @@ impl f128 {
802802
///
803803
/// If one of the arguments is NaN, then NaN is returned. Otherwise this returns the lesser
804804
/// of the two numbers. For this operation, -0.0 is considered to be less than +0.0.
805-
/// Note that this follows the semantics specified in IEEE 754-2019.
805+
/// Note that this follows the IEEE 754-2019 semantics for `minimum`.
806806
///
807807
/// Also note that "propagation" of NaNs here doesn't necessarily mean that the bitpattern of a NaN
808808
/// operand is conserved; see the [specification of NaN bit patterns](f32#nan-bit-patterns) for more info.

library/core/src/num/f16.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -688,8 +688,8 @@ impl f16 {
688688
/// Returns the maximum of the two numbers, ignoring NaN.
689689
///
690690
/// If one of the arguments is NaN, then the other argument is returned.
691-
/// This follows the IEEE 754-2008 semantics for maxNum, except for handling of signaling NaNs;
692-
/// this function handles all NaNs the same way and avoids maxNum's problems with associativity.
691+
/// This follows the IEEE 754-2008 semantics for `maxNum`, except for handling of signaling NaNs;
692+
/// this function handles all NaNs the same way and avoids `maxNum`'s problems with associativity.
693693
/// This also matches the behavior of libm’s fmax. In particular, if the inputs compare equal
694694
/// (such as for the case of `+0.0` and `-0.0`), either input may be returned non-deterministically.
695695
///
@@ -715,8 +715,8 @@ impl f16 {
715715
/// Returns the minimum of the two numbers, ignoring NaN.
716716
///
717717
/// If one of the arguments is NaN, then the other argument is returned.
718-
/// This follows the IEEE 754-2008 semantics for minNum, except for handling of signaling NaNs;
719-
/// this function handles all NaNs the same way and avoids minNum's problems with associativity.
718+
/// This follows the IEEE 754-2008 semantics for `minNum`, except for handling of signaling NaNs;
719+
/// this function handles all NaNs the same way and avoids `minNum`'s problems with associativity.
720720
/// This also matches the behavior of libm’s fmin. In particular, if the inputs compare equal
721721
/// (such as for the case of `+0.0` and `-0.0`), either input may be returned non-deterministically.
722722
///
@@ -759,7 +759,7 @@ impl f16 {
759759
///
760760
/// If one of the arguments is NaN, then NaN is returned. Otherwise this returns the greater
761761
/// of the two numbers. For this operation, -0.0 is considered to be less than +0.0.
762-
/// Note that this follows the semantics specified in IEEE 754-2019.
762+
/// Note that this follows the IEEE 754-2019 semantics for `maximum`.
763763
///
764764
/// Also note that "propagation" of NaNs here doesn't necessarily mean that the bitpattern of a NaN
765765
/// operand is conserved; see the [specification of NaN bit patterns](f32#nan-bit-patterns) for more info.
@@ -791,7 +791,7 @@ impl f16 {
791791
///
792792
/// If one of the arguments is NaN, then NaN is returned. Otherwise this returns the lesser
793793
/// of the two numbers. For this operation, -0.0 is considered to be less than +0.0.
794-
/// Note that this follows the semantics specified in IEEE 754-2019.
794+
/// Note that this follows the IEEE 754-2019 semantics for `minimum`.
795795
///
796796
/// Also note that "propagation" of NaNs here doesn't necessarily mean that the bitpattern of a NaN
797797
/// operand is conserved; see the [specification of NaN bit patterns](f32#nan-bit-patterns) for more info.

library/core/src/num/f32.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -898,8 +898,8 @@ impl f32 {
898898
/// Returns the maximum of the two numbers, ignoring NaN.
899899
///
900900
/// If one of the arguments is NaN, then the other argument is returned.
901-
/// This follows the IEEE 754-2008 semantics for maxNum, except for handling of signaling NaNs;
902-
/// this function handles all NaNs the same way and avoids maxNum's problems with associativity.
901+
/// This follows the IEEE 754-2008 semantics for `maxNum`, except for handling of signaling NaNs;
902+
/// this function handles all NaNs the same way and avoids `maxNum`'s problems with associativity.
903903
/// This also matches the behavior of libm’s fmax. In particular, if the inputs compare equal
904904
/// (such as for the case of `+0.0` and `-0.0`), either input may be returned non-deterministically.
905905
///
@@ -921,8 +921,8 @@ impl f32 {
921921
/// Returns the minimum of the two numbers, ignoring NaN.
922922
///
923923
/// If one of the arguments is NaN, then the other argument is returned.
924-
/// This follows the IEEE 754-2008 semantics for minNum, except for handling of signaling NaNs;
925-
/// this function handles all NaNs the same way and avoids minNum's problems with associativity.
924+
/// This follows the IEEE 754-2008 semantics for `minNum`, except for handling of signaling NaNs;
925+
/// this function handles all NaNs the same way and avoids `minNum`'s problems with associativity.
926926
/// This also matches the behavior of libm’s fmin. In particular, if the inputs compare equal
927927
/// (such as for the case of `+0.0` and `-0.0`), either input may be returned non-deterministically.
928928
///
@@ -957,7 +957,7 @@ impl f32 {
957957
///
958958
/// If one of the arguments is NaN, then NaN is returned. Otherwise this returns the greater
959959
/// of the two numbers. For this operation, -0.0 is considered to be less than +0.0.
960-
/// Note that this follows the semantics specified in IEEE 754-2019.
960+
/// Note that this follows the IEEE 754-2019 semantics for `maximum`.
961961
///
962962
/// Also note that "propagation" of NaNs here doesn't necessarily mean that the bitpattern of a NaN
963963
/// operand is conserved; see the [specification of NaN bit patterns](f32#nan-bit-patterns) for more info.
@@ -984,7 +984,7 @@ impl f32 {
984984
///
985985
/// If one of the arguments is NaN, then NaN is returned. Otherwise this returns the lesser
986986
/// of the two numbers. For this operation, -0.0 is considered to be less than +0.0.
987-
/// Note that this follows the semantics specified in IEEE 754-2019.
987+
/// Note that this follows the IEEE 754-2019 semantics for `minimum`.
988988
///
989989
/// Also note that "propagation" of NaNs here doesn't necessarily mean that the bitpattern of a NaN
990990
/// operand is conserved; see the [specification of NaN bit patterns](f32#nan-bit-patterns) for more info.

library/core/src/num/f64.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -916,8 +916,8 @@ impl f64 {
916916
/// Returns the maximum of the two numbers, ignoring NaN.
917917
///
918918
/// If one of the arguments is NaN, then the other argument is returned.
919-
/// This follows the IEEE 754-2008 semantics for maxNum, except for handling of signaling NaNs;
920-
/// this function handles all NaNs the same way and avoids maxNum's problems with associativity.
919+
/// This follows the IEEE 754-2008 semantics for `maxNum`, except for handling of signaling NaNs;
920+
/// this function handles all NaNs the same way and avoids `maxNum`'s problems with associativity.
921921
/// This also matches the behavior of libm’s fmax. In particular, if the inputs compare equal
922922
/// (such as for the case of `+0.0` and `-0.0`), either input may be returned non-deterministically.
923923
///
@@ -939,8 +939,8 @@ impl f64 {
939939
/// Returns the minimum of the two numbers, ignoring NaN.
940940
///
941941
/// If one of the arguments is NaN, then the other argument is returned.
942-
/// This follows the IEEE 754-2008 semantics for minNum, except for handling of signaling NaNs;
943-
/// this function handles all NaNs the same way and avoids minNum's problems with associativity.
942+
/// This follows the IEEE 754-2008 semantics for `minNum`, except for handling of signaling NaNs;
943+
/// this function handles all NaNs the same way and avoids `minNum`'s problems with associativity.
944944
/// This also matches the behavior of libm’s fmin. In particular, if the inputs compare equal
945945
/// (such as for the case of `+0.0` and `-0.0`), either input may be returned non-deterministically.
946946
///
@@ -975,7 +975,7 @@ impl f64 {
975975
///
976976
/// If one of the arguments is NaN, then NaN is returned. Otherwise this returns the greater
977977
/// of the two numbers. For this operation, -0.0 is considered to be less than +0.0.
978-
/// Note that this follows the semantics specified in IEEE 754-2019.
978+
/// Note that this follows the IEEE 754-2019 semantics for `maximum`.
979979
///
980980
/// Also note that "propagation" of NaNs here doesn't necessarily mean that the bitpattern of a NaN
981981
/// operand is conserved; see the [specification of NaN bit patterns](f32#nan-bit-patterns) for more info.
@@ -1002,7 +1002,7 @@ impl f64 {
10021002
///
10031003
/// If one of the arguments is NaN, then NaN is returned. Otherwise this returns the lesser
10041004
/// of the two numbers. For this operation, -0.0 is considered to be less than +0.0.
1005-
/// Note that this follows the semantics specified in IEEE 754-2019.
1005+
/// Note that this follows the IEEE 754-2019 semantics for `minimum`.
10061006
///
10071007
/// Also note that "propagation" of NaNs here doesn't necessarily mean that the bitpattern of a NaN
10081008
/// operand is conserved; see the [specification of NaN bit patterns](f32#nan-bit-patterns) for more info.

0 commit comments

Comments
 (0)