Commit eb67f49
committed
Deprecate {f32,f64}::abs_sub.
The abs_sub name is misleading: the function actually computes the
positive difference (`fdim` in C), not the `(x - y).abs()` that *many* people expect
from the name.
This function can be replaced with just `(x - y).max(0.0)`, mirroring
the `abs` version, but this behaves differently with NAN: `NAN.max(0.0)
== 0.0`, while `NAN.positive_diff(0.0) == NAN`. People who absolutely
need that behaviour can use the C function directly and/or talk to the libs
team (we haven't encountered a concrete use-case for this functionality).
Closes #30315.1 parent bb39c49 commit eb67f49
2 files changed
+24
-46
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
829 | 829 | | |
830 | 830 | | |
831 | 831 | | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
832 | 839 | | |
833 | 840 | | |
834 | 841 | | |
| |||
939 | 946 | | |
940 | 947 | | |
941 | 948 | | |
942 | | - | |
| 949 | + | |
943 | 950 | | |
944 | 951 | | |
945 | 952 | | |
| |||
959 | 966 | | |
960 | 967 | | |
961 | 968 | | |
962 | | - | |
| 969 | + | |
963 | 970 | | |
964 | 971 | | |
965 | 972 | | |
| |||
978 | 985 | | |
979 | 986 | | |
980 | 987 | | |
981 | | - | |
| 988 | + | |
982 | 989 | | |
983 | 990 | | |
984 | 991 | | |
| |||
1048 | 1055 | | |
1049 | 1056 | | |
1050 | 1057 | | |
1051 | | - | |
| 1058 | + | |
1052 | 1059 | | |
1053 | 1060 | | |
1054 | 1061 | | |
| |||
1108 | 1115 | | |
1109 | 1116 | | |
1110 | 1117 | | |
1111 | | - | |
| 1118 | + | |
1112 | 1119 | | |
1113 | 1120 | | |
1114 | 1121 | | |
| |||
1191 | 1198 | | |
1192 | 1199 | | |
1193 | 1200 | | |
1194 | | - | |
| 1201 | + | |
1195 | 1202 | | |
1196 | | - | |
| 1203 | + | |
1197 | 1204 | | |
1198 | 1205 | | |
1199 | 1206 | | |
| |||
1747 | 1754 | | |
1748 | 1755 | | |
1749 | 1756 | | |
1750 | | - | |
1751 | | - | |
1752 | | - | |
1753 | | - | |
1754 | | - | |
1755 | | - | |
1756 | | - | |
1757 | | - | |
1758 | | - | |
1759 | | - | |
1760 | | - | |
1761 | | - | |
1762 | | - | |
1763 | | - | |
1764 | | - | |
1765 | | - | |
1766 | | - | |
1767 | | - | |
1768 | 1757 | | |
1769 | 1758 | | |
1770 | 1759 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
718 | 718 | | |
719 | 719 | | |
720 | 720 | | |
721 | | - | |
722 | | - | |
723 | | - | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
724 | 731 | | |
725 | 732 | | |
726 | 733 | | |
| |||
1642 | 1649 | | |
1643 | 1650 | | |
1644 | 1651 | | |
1645 | | - | |
1646 | | - | |
1647 | | - | |
1648 | | - | |
1649 | | - | |
1650 | | - | |
1651 | | - | |
1652 | | - | |
1653 | | - | |
1654 | | - | |
1655 | | - | |
1656 | | - | |
1657 | | - | |
1658 | | - | |
1659 | | - | |
1660 | | - | |
1661 | | - | |
1662 | | - | |
1663 | 1652 | | |
1664 | 1653 | | |
1665 | 1654 | | |
| |||
0 commit comments