Skip to content

Commit 2c6b820

Browse files
jensmaurertkoeppe
authored andcommitted
P2614R2 Deprecate numeric_limits::has_denorm
In [depr.numeric.limits.has.denorm], an explicit mention of "the specialization numeric_limits<bool>" has been used instead of the paper's reference to "paragraph 3", since paragraph references are not allowed. Fixes NB DE 079 (C++23 CD).
1 parent cc5f872 commit 2c6b820

File tree

3 files changed

+50
-93
lines changed

3 files changed

+50
-93
lines changed

source/future.tex

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,48 @@
218218
unless the function's \throws element
219219
specifies throwing an exception when the precondition is violated.
220220

221+
\rSec1[depr.numeric.limits.has.denorm]{\tcode{has_denorm} members in \tcode{numeric_limits}}
222+
223+
\pnum
224+
The following type is defined
225+
in addition to those specified in \libheaderref{limits}:
226+
\indexlibraryglobal{float_denorm_style}%
227+
\begin{codeblock}
228+
namespace std {
229+
enum float_denorm_style {
230+
denorm_indeterminate = -1,
231+
denorm_absent = 0,
232+
denorm_present = 1
233+
};
234+
}
235+
\end{codeblock}
236+
237+
\pnum
238+
\indextext{denormalized value|see{number, subnormal}}%
239+
\indextext{value!denormalized|see{number, subnormal}}%
240+
\indextext{subnormal number|see{number, subnormal}}%
241+
\indextext{number!subnormal}%
242+
The following members are defined
243+
in addition to those specified in \ref{numeric.limits.general}:
244+
\begin{codeblock}
245+
static constexpr float_denorm_style has_denorm = denorm_absent;
246+
static constexpr bool has_denorm_loss = false;
247+
\end{codeblock}
248+
249+
\pnum
250+
The values of \tcode{has_denorm} and \tcode{has_denorm_loss} of
251+
specializations of \tcode{numeric_limits} are unspecified.
252+
253+
\pnum
254+
The following members of the specialization \tcode{numeric_limits<bool>} are defined
255+
in addition to those specified in \ref{numeric.special}:
256+
\indexlibrarymember{float_denorm_style}{numeric_limits}%
257+
\indexlibrarymember{has_denorm_loss}{numeric_limits}%
258+
\begin{codeblock}
259+
static constexpr float_denorm_style has_denorm = denorm_absent;
260+
static constexpr bool has_denorm_loss = false;
261+
\end{codeblock}
262+
221263
\rSec1[depr.c.macros]{Deprecated C macros}
222264

223265
\pnum

source/support.tex

Lines changed: 4 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -759,14 +759,12 @@
759759
\indextext{\idxcode{numeric_limits}}%
760760
\indexlibraryglobal{numeric_limits}%
761761
\indexlibraryglobal{float_round_style}%
762-
\indexlibraryglobal{float_denorm_style}%
763762

764763
\begin{codeblock}
765764
// all freestanding
766765
namespace std {
767-
// \ref{fp.style}, floating-point type properties
766+
// \ref{round.style}, enumeration \tcode{float_round_style}
768767
enum float_round_style;
769-
enum float_denorm_style;
770768

771769
// \ref{numeric.limits}, class template \tcode{numeric_limits}
772770
template<class T> class numeric_limits;
@@ -800,9 +798,7 @@
800798
}
801799
\end{codeblock}
802800

803-
\rSec2[fp.style]{Floating-point type properties}
804-
805-
\rSec3[round.style]{Type \tcode{float_round_style}}
801+
\rSec2[round.style]{Enum \tcode{float_round_style}}
806802

807803
\indexlibraryglobal{float_round_style}%
808804
\begin{codeblock}
@@ -843,41 +839,6 @@
843839
if the rounding style is toward negative infinity
844840
\end{itemize}
845841

846-
\rSec3[denorm.style]{Type \tcode{float_denorm_style}}
847-
848-
\indexlibraryglobal{float_denorm_style}%
849-
\begin{codeblock}
850-
namespace std {
851-
enum float_denorm_style {
852-
denorm_indeterminate = -1,
853-
denorm_absent = 0,
854-
denorm_present = 1
855-
};
856-
}
857-
\end{codeblock}
858-
859-
\indextext{denormalized value|see{number, subnormal}}%
860-
\indextext{value!denormalized|see{number, subnormal}}%
861-
\indextext{subnormal number|see{number, subnormal}}%
862-
\indextext{number!subnormal}%
863-
\pnum
864-
The presence or absence of subnormal numbers (variable number of exponent bits)
865-
is characterized by the values:
866-
\begin{itemize}
867-
\item
868-
\indexlibraryglobal{denorm_indeterminate}%
869-
\tcode{denorm_indeterminate}
870-
if it cannot be determined whether or not the type allows subnormal values
871-
\item
872-
\indexlibraryglobal{denorm_absent}%
873-
\tcode{denorm_absent}
874-
if the type does not allow subnormal values
875-
\item
876-
\indexlibraryglobal{denorm_present}%
877-
\tcode{denorm_present}
878-
if the type does allow subnormal values
879-
\end{itemize}
880-
881842
\rSec2[numeric.limits]{Class template \tcode{numeric_limits}}
882843

883844
\rSec3[numeric.limits.general]{General}
@@ -918,8 +879,6 @@
918879
static constexpr bool has_infinity = false;
919880
static constexpr bool has_quiet_NaN = false;
920881
static constexpr bool has_signaling_NaN = false;
921-
static constexpr float_denorm_style has_denorm = denorm_absent;
922-
static constexpr bool has_denorm_loss = false;
923882
static constexpr T infinity() noexcept { return T(); }
924883
static constexpr T quiet_NaN() noexcept { return T(); }
925884
static constexpr T signaling_NaN() noexcept { return T(); }
@@ -1340,46 +1299,6 @@
13401299
\tcode{is_iec559 != false}.
13411300
\end{itemdescr}
13421301

1343-
\indexlibrarymember{float_denorm_style}{numeric_limits}%
1344-
\begin{itemdecl}
1345-
static constexpr float_denorm_style has_denorm;
1346-
\end{itemdecl}
1347-
1348-
\indextext{number!subnormal}%
1349-
\begin{itemdescr}
1350-
\pnum
1351-
\tcode{denorm_present}
1352-
if the type allows subnormal values
1353-
(variable number of exponent bits),
1354-
\begin{footnote}
1355-
Required by LIA-1.
1356-
\end{footnote}
1357-
\tcode{denorm_absent}
1358-
if the type does not allow subnormal values,
1359-
and
1360-
\tcode{denorm_indeterminate}
1361-
if it is indeterminate at compile time whether the type allows
1362-
subnormal values.
1363-
1364-
\pnum
1365-
Meaningful for all floating-point types.
1366-
\end{itemdescr}
1367-
1368-
\indexlibrarymember{has_denorm_loss}{numeric_limits}%
1369-
\begin{itemdecl}
1370-
static constexpr bool has_denorm_loss;
1371-
\end{itemdecl}
1372-
1373-
\begin{itemdescr}
1374-
\pnum
1375-
\tcode{true} if loss of accuracy is detected as a
1376-
denormalization loss, rather than as an inexact result.
1377-
\begin{footnote}
1378-
See
1379-
ISO/IEC/IEEE 60559.
1380-
\end{footnote}
1381-
\end{itemdescr}
1382-
13831302
\indexlibrarymember{infinity}{numeric_limits}%
13841303
\begin{itemdecl}
13851304
static constexpr T infinity() noexcept;
@@ -1445,18 +1364,14 @@
14451364
\begin{itemdescr}
14461365
\indextext{number!subnormal}%
14471366
\pnum
1448-
Minimum positive subnormal value.
1367+
Minimum positive subnormal value, if available.
14491368
\begin{footnote}
14501369
Required by LIA-1.
14511370
\end{footnote}
1371+
Otherwise, minimum positive normalized value.
14521372

14531373
\pnum
14541374
Meaningful for all floating-point types.
1455-
1456-
\pnum
1457-
In specializations for which
1458-
\tcode{has_denorm == false},
1459-
returns the minimum positive normalized value.
14601375
\end{itemdescr}
14611376

14621377
\indexlibrarymember{is_iec559}{numeric_limits}%
@@ -1630,8 +1545,6 @@
16301545
static constexpr bool has_infinity = true;
16311546
static constexpr bool has_quiet_NaN = true;
16321547
static constexpr bool has_signaling_NaN = true;
1633-
static constexpr float_denorm_style has_denorm = denorm_absent;
1634-
static constexpr bool has_denorm_loss = false;
16351548

16361549
static constexpr float infinity() noexcept { return @\textit{value}@; }
16371550
static constexpr float quiet_NaN() noexcept { return @\textit{value}@; }
@@ -1683,8 +1596,6 @@
16831596
static constexpr bool has_infinity = false;
16841597
static constexpr bool has_quiet_NaN = false;
16851598
static constexpr bool has_signaling_NaN = false;
1686-
static constexpr float_denorm_style has_denorm = denorm_absent;
1687-
static constexpr bool has_denorm_loss = false;
16881599
static constexpr bool infinity() noexcept { return 0; }
16891600
static constexpr bool quiet_NaN() noexcept { return 0; }
16901601
static constexpr bool signaling_NaN() noexcept { return 0; }

source/xrefdelta.tex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,9 @@
110110
\movedxref{expos.only.func}{expos.only.entity}
111111
\removedxref{expos.only.types}
112112

113+
% P2614R2 Deprecate numeric_limits::has_denorm
114+
\movedxref{denorm.style}{depr.numeric.limits.has.denorm}
115+
\removedxref{fp.style}
116+
113117
% Deprecated features.
114118
%\deprxref{old.label} (if moved to depr.old.label, otherwise use \movedxref)

0 commit comments

Comments
 (0)