Skip to content

P2614R2 Deprecate numeric_limits::has_denorm #6141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions source/future.tex
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,48 @@
unless the function's \throws element
specifies throwing an exception when the precondition is violated.

\rSec1[depr.numeric.limits.has.denorm]{\tcode{has_denorm} members in \tcode{numeric_limits}}

\pnum
The following type is defined
in addition to those specified in \libheaderref{limits}:
\indexlibraryglobal{float_denorm_style}%
\begin{codeblock}
namespace std {
enum float_denorm_style {
denorm_indeterminate = -1,
denorm_absent = 0,
denorm_present = 1
};
}
\end{codeblock}

\pnum
\indextext{denormalized value|see{number, subnormal}}%
\indextext{value!denormalized|see{number, subnormal}}%
\indextext{subnormal number|see{number, subnormal}}%
\indextext{number!subnormal}%
The following members are defined
in addition to those specified in \ref{numeric.limits.general}:
\begin{codeblock}
static constexpr float_denorm_style has_denorm = denorm_absent;
static constexpr bool has_denorm_loss = false;
\end{codeblock}

\pnum
The values of \tcode{has_denorm} and \tcode{has_denorm_loss} of
specializations of \tcode{numeric_limits} are unspecified.

\pnum
The following members of the specialization \tcode{numeric_limits<bool>} are defined
in addition to those specified in \ref{numeric.special}:
\indexlibrarymember{float_denorm_style}{numeric_limits}%
\indexlibrarymember{has_denorm_loss}{numeric_limits}%
\begin{codeblock}
static constexpr float_denorm_style has_denorm = denorm_absent;
static constexpr bool has_denorm_loss = false;
\end{codeblock}

\rSec1[depr.c.macros]{Deprecated C macros}

\pnum
Expand Down
97 changes: 4 additions & 93 deletions source/support.tex
Original file line number Diff line number Diff line change
Expand Up @@ -759,14 +759,12 @@
\indextext{\idxcode{numeric_limits}}%
\indexlibraryglobal{numeric_limits}%
\indexlibraryglobal{float_round_style}%
\indexlibraryglobal{float_denorm_style}%

\begin{codeblock}
// all freestanding
namespace std {
// \ref{fp.style}, floating-point type properties
// \ref{round.style}, enumeration \tcode{float_round_style}
enum float_round_style;
enum float_denorm_style;

// \ref{numeric.limits}, class template \tcode{numeric_limits}
template<class T> class numeric_limits;
Expand Down Expand Up @@ -800,9 +798,7 @@
}
\end{codeblock}

\rSec2[fp.style]{Floating-point type properties}

\rSec3[round.style]{Type \tcode{float_round_style}}
\rSec2[round.style]{Enum \tcode{float_round_style}}

\indexlibraryglobal{float_round_style}%
\begin{codeblock}
Expand Down Expand Up @@ -843,41 +839,6 @@
if the rounding style is toward negative infinity
\end{itemize}

\rSec3[denorm.style]{Type \tcode{float_denorm_style}}

\indexlibraryglobal{float_denorm_style}%
\begin{codeblock}
namespace std {
enum float_denorm_style {
denorm_indeterminate = -1,
denorm_absent = 0,
denorm_present = 1
};
}
\end{codeblock}

\indextext{denormalized value|see{number, subnormal}}%
\indextext{value!denormalized|see{number, subnormal}}%
\indextext{subnormal number|see{number, subnormal}}%
\indextext{number!subnormal}%
\pnum
The presence or absence of subnormal numbers (variable number of exponent bits)
is characterized by the values:
\begin{itemize}
\item
\indexlibraryglobal{denorm_indeterminate}%
\tcode{denorm_indeterminate}
if it cannot be determined whether or not the type allows subnormal values
\item
\indexlibraryglobal{denorm_absent}%
\tcode{denorm_absent}
if the type does not allow subnormal values
\item
\indexlibraryglobal{denorm_present}%
\tcode{denorm_present}
if the type does allow subnormal values
\end{itemize}

\rSec2[numeric.limits]{Class template \tcode{numeric_limits}}

\rSec3[numeric.limits.general]{General}
Expand Down Expand Up @@ -918,8 +879,6 @@
static constexpr bool has_infinity = false;
static constexpr bool has_quiet_NaN = false;
static constexpr bool has_signaling_NaN = false;
static constexpr float_denorm_style has_denorm = denorm_absent;
static constexpr bool has_denorm_loss = false;
static constexpr T infinity() noexcept { return T(); }
static constexpr T quiet_NaN() noexcept { return T(); }
static constexpr T signaling_NaN() noexcept { return T(); }
Expand Down Expand Up @@ -1340,46 +1299,6 @@
\tcode{is_iec559 != false}.
\end{itemdescr}

\indexlibrarymember{float_denorm_style}{numeric_limits}%
\begin{itemdecl}
static constexpr float_denorm_style has_denorm;
\end{itemdecl}

\indextext{number!subnormal}%
\begin{itemdescr}
\pnum
\tcode{denorm_present}
if the type allows subnormal values
(variable number of exponent bits),
\begin{footnote}
Required by LIA-1.
\end{footnote}
\tcode{denorm_absent}
if the type does not allow subnormal values,
and
\tcode{denorm_indeterminate}
if it is indeterminate at compile time whether the type allows
subnormal values.

\pnum
Meaningful for all floating-point types.
\end{itemdescr}

\indexlibrarymember{has_denorm_loss}{numeric_limits}%
\begin{itemdecl}
static constexpr bool has_denorm_loss;
\end{itemdecl}

\begin{itemdescr}
\pnum
\tcode{true} if loss of accuracy is detected as a
denormalization loss, rather than as an inexact result.
\begin{footnote}
See
ISO/IEC/IEEE 60559.
\end{footnote}
\end{itemdescr}

\indexlibrarymember{infinity}{numeric_limits}%
\begin{itemdecl}
static constexpr T infinity() noexcept;
Expand Down Expand Up @@ -1445,18 +1364,14 @@
\begin{itemdescr}
\indextext{number!subnormal}%
\pnum
Minimum positive subnormal value.
Minimum positive subnormal value, if available.
\begin{footnote}
Required by LIA-1.
\end{footnote}
Otherwise, minimum positive normalized value.

\pnum
Meaningful for all floating-point types.

\pnum
In specializations for which
\tcode{has_denorm == false},
returns the minimum positive normalized value.
\end{itemdescr}

\indexlibrarymember{is_iec559}{numeric_limits}%
Expand Down Expand Up @@ -1630,8 +1545,6 @@
static constexpr bool has_infinity = true;
static constexpr bool has_quiet_NaN = true;
static constexpr bool has_signaling_NaN = true;
static constexpr float_denorm_style has_denorm = denorm_absent;
static constexpr bool has_denorm_loss = false;

static constexpr float infinity() noexcept { return @\textit{value}@; }
static constexpr float quiet_NaN() noexcept { return @\textit{value}@; }
Expand Down Expand Up @@ -1683,8 +1596,6 @@
static constexpr bool has_infinity = false;
static constexpr bool has_quiet_NaN = false;
static constexpr bool has_signaling_NaN = false;
static constexpr float_denorm_style has_denorm = denorm_absent;
static constexpr bool has_denorm_loss = false;
static constexpr bool infinity() noexcept { return 0; }
static constexpr bool quiet_NaN() noexcept { return 0; }
static constexpr bool signaling_NaN() noexcept { return 0; }
Expand Down
4 changes: 4 additions & 0 deletions source/xrefdelta.tex
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,9 @@
\movedxref{expos.only.func}{expos.only.entity}
\removedxref{expos.only.types}

% P2614R2 Deprecate numeric_limits::has_denorm
\movedxref{denorm.style}{depr.numeric.limits.has.denorm}
\removedxref{fp.style}

% Deprecated features.
%\deprxref{old.label} (if moved to depr.old.label, otherwise use \movedxref)