Skip to content

Commit f8904bd

Browse files
jensmaurerzygoloid
authored andcommitted
[support.limits] Rearrange section 'Implementation properties'
- Change order of subsections. - Remove [limits] and [c.limits] subsection headings. - Move descriptions of numeric_limits members and specializations as subsections under the description of the primary class template. - Add sectioning comments to the <limits> synopsis. Fixes #785.
1 parent 9a6d4c3 commit f8904bd

File tree

3 files changed

+125
-126
lines changed

3 files changed

+125
-126
lines changed

source/basic.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3849,7 +3849,7 @@
38493849
\indextext{floating point type!implementation-defined}%
38503850
\begin{note}
38513851
This International Standard imposes no requirements on the accuracy of
3852-
floating-point operations; see also~\ref{limits}.
3852+
floating-point operations; see also~\ref{support.limits}.
38533853
\end{note}
38543854
Integral and floating types are collectively
38553855
called \defnx{arithmetic}{type!arithmetic} types.

source/iostreams.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5234,7 +5234,7 @@
52345234
Characters are extracted until any of the following occurs:
52355235
\begin{itemize}
52365236
\item
5237-
\tcode{n != numeric_limits<streamsize>::max()}~(\ref{limits})
5237+
\tcode{n != numeric_limits<streamsize>::max()}~(\ref{numeric.limits})
52385238
and
52395239
\tcode{n} characters have been extracted so far
52405240
\item

source/support.tex

Lines changed: 123 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -306,54 +306,17 @@
306306

307307
\rSec1[support.limits]{Implementation properties}
308308

309-
\rSec2[support.limits.general]{In general}
309+
\rSec2[support.limits.general]{General}
310310

311311
\pnum
312312
The headers
313-
\tcode{<limits>}~(\ref{limits}),
313+
\tcode{<limits>}~(\ref{limits.syn}),
314314
\tcode{<climits>}~(\ref{climits.syn}), and
315315
\tcode{<cfloat>}~(\ref{cfloat.syn})
316316
supply characteristics of implementation-dependent
317317
arithmetic types~(\ref{basic.fundamental}).
318318

319-
\rSec2[limits]{Numeric limits}
320-
321-
\rSec3[limits.numeric]{Class template \tcode{numeric_limits}}
322-
323-
\pnum
324-
The
325-
\indexlibrary{\idxcode{numeric_limits}}%
326-
\tcode{numeric_limits}
327-
class template provides a \Cpp program with information about various properties of
328-
the implementation's representation of the
329-
arithmetic types.
330-
331-
\pnum
332-
Specializations shall be provided for each
333-
arithmetic type,
334-
both floating-point and integer, including
335-
\tcode{bool}.
336-
The member
337-
\tcode{is_specialized}
338-
shall be
339-
\tcode{true}
340-
for all such specializations of
341-
\tcode{numeric_limits}.
342-
343-
\pnum
344-
For all members declared
345-
\tcode{static} \tcode{constexpr}
346-
in the
347-
\tcode{numeric_limits}
348-
template, specializations shall define these values in such a way
349-
that they are usable as
350-
constant expressions.
351-
352-
\pnum
353-
Non-arithmetic standard types, such as
354-
\tcode{complex<T>}~(\ref{complex}), shall not have specializations.
355-
356-
\rSec3[limits.syn]{Header \tcode{<limits>} synopsis}
319+
\rSec2[limits.syn]{Header \tcode{<limits>} synopsis}
357320
\indextext{\idxhdr{limits}}%
358321
\indexlibrary{\idxhdr{limits}}%
359322
\indextext{\idxcode{numeric_limits}}%
@@ -363,10 +326,13 @@
363326

364327
\begin{codeblock}
365328
namespace std {
366-
template<class T> class numeric_limits;
329+
// \ref{fp.style}, floating-point type properties
367330
enum float_round_style;
368331
enum float_denorm_style;
369332

333+
// \ref{numeric.limits}, class template numeric_limits
334+
template<class T> class numeric_limits;
335+
370336
template<> class numeric_limits<bool>;
371337

372338
template<> class numeric_limits<char>;
@@ -391,7 +357,95 @@
391357
}
392358
\end{codeblock}
393359

394-
\rSec3[numeric.limits]{Class template \tcode{numeric_limits}}
360+
\rSec2[fp.style]{Floating-point type properties}
361+
362+
\rSec3[round.style]{Type \tcode{float_round_style}}
363+
364+
\indexlibrary{\idxcode{float_round_style}}%
365+
\begin{codeblock}
366+
namespace std {
367+
enum float_round_style {
368+
round_indeterminate = -1,
369+
round_toward_zero = 0,
370+
round_to_nearest = 1,
371+
round_toward_infinity = 2,
372+
round_toward_neg_infinity = 3
373+
};
374+
}
375+
\end{codeblock}
376+
377+
\pnum
378+
The rounding mode for floating-point arithmetic is characterized by the
379+
values:
380+
381+
\begin{itemize}
382+
\item
383+
\indexlibrary{\idxcode{round_indeterminate}}%
384+
\tcode{round_indeterminate}
385+
if the rounding style is indeterminable
386+
\item
387+
\indexlibrary{\idxcode{round_toward_zero}}%
388+
\tcode{round_toward_zero}
389+
if the rounding style is toward zero
390+
\item
391+
\indexlibrary{\idxcode{round_to_nearest}}%
392+
\tcode{round_to_nearest}
393+
if the rounding style is to the nearest representable value
394+
\item
395+
\indexlibrary{\idxcode{round_toward_infinity}}%
396+
\tcode{round_toward_infinity}
397+
if the rounding style is toward infinity
398+
\item
399+
\indexlibrary{\idxcode{round_toward_neg_infinity}}%
400+
\tcode{round_toward_neg_infinity}
401+
if the rounding style is toward negative infinity
402+
\end{itemize}
403+
404+
\rSec3[denorm.style]{Type \tcode{float_denorm_style}}
405+
406+
\indexlibrary{\idxcode{float_denorm_style}}%
407+
\begin{codeblock}
408+
namespace std {
409+
enum float_denorm_style {
410+
denorm_indeterminate = -1,
411+
denorm_absent = 0,
412+
denorm_present = 1
413+
};
414+
}
415+
\end{codeblock}
416+
417+
\indextext{denormalized value|see{number, subnormal}}%
418+
\indextext{value!denormalized|see{number, subnormal}}%
419+
\indextext{subnormal number|see{number, subnormal}}%
420+
\indextext{number!subnormal}%
421+
\pnum
422+
The presence or absence of subnormal numbers (variable number of exponent bits)
423+
is characterized by the values:
424+
425+
\begin{itemize}
426+
\item
427+
\indexlibrary{\idxcode{denorm_indeterminate}}%
428+
\tcode{denorm_indeterminate}
429+
if it cannot be determined whether or not the type allows subnormal values
430+
\item
431+
\indexlibrary{\idxcode{denorm_absent}}%
432+
\tcode{denorm_absent}
433+
if the type does not allow subnormal values
434+
\item
435+
\indexlibrary{\idxcode{denorm_present}}%
436+
\tcode{denorm_present}
437+
if the type does allow subnormal values
438+
\end{itemize}
439+
440+
\rSec2[numeric.limits]{Class template \tcode{numeric_limits}}
441+
442+
\pnum
443+
The
444+
\indexlibrary{\idxcode{numeric_limits}}%
445+
\tcode{numeric_limits}
446+
class template provides a \Cpp program with information about various properties of
447+
the implementation's representation of the
448+
arithmetic types.
395449

396450
\indexlibrary{\idxcode{numeric_limits}}%
397451
\begin{codeblock}
@@ -443,19 +497,44 @@
443497
}
444498
\end{codeblock}
445499

500+
\pnum
501+
For all members declared
502+
\tcode{static} \tcode{constexpr}
503+
in the
504+
\tcode{numeric_limits}
505+
template, specializations shall define these values in such a way
506+
that they are usable as
507+
constant expressions.
508+
446509
\pnum
447510
The default
448511
\tcode{numeric_limits<T>}
449512
template shall have all members, but with 0 or
450513
\tcode{false}
451514
values.
452515

516+
\pnum
517+
Specializations shall be provided for each
518+
arithmetic type,
519+
both floating-point and integer, including
520+
\tcode{bool}.
521+
The member
522+
\tcode{is_specialized}
523+
shall be
524+
\tcode{true}
525+
for all such specializations of
526+
\tcode{numeric_limits}.
527+
453528
\pnum
454529
The value of each member of a specialization of
455530
\tcode{numeric_limits} on a cv-qualified type
456531
\tcode{cv T} shall be equal to the value of the corresponding member of
457532
the specialization on the unqualified type \tcode{T}.
458533

534+
\pnum
535+
Non-arithmetic standard types, such as
536+
\tcode{complex<T>}~(\ref{complex}), shall not have specializations.
537+
459538
\rSec3[numeric.limits.members]{\tcode{numeric_limits} members}
460539

461540
\indexlibrarymember{min}{numeric_limits}%
@@ -969,84 +1048,6 @@
9691048
\tcode{round_toward_zero}.
9701049
\end{itemdescr}
9711050

972-
\rSec3[round.style]{Type \tcode{float_round_style}}
973-
974-
\indexlibrary{\idxcode{float_round_style}}%
975-
\begin{codeblock}
976-
namespace std {
977-
enum float_round_style {
978-
round_indeterminate = -1,
979-
round_toward_zero = 0,
980-
round_to_nearest = 1,
981-
round_toward_infinity = 2,
982-
round_toward_neg_infinity = 3
983-
};
984-
}
985-
\end{codeblock}
986-
987-
\pnum
988-
The rounding mode for floating-point arithmetic is characterized by the
989-
values:
990-
991-
\begin{itemize}
992-
\item
993-
\indexlibrary{\idxcode{round_indeterminate}}%
994-
\tcode{round_indeterminate}
995-
if the rounding style is indeterminable
996-
\item
997-
\indexlibrary{\idxcode{round_toward_zero}}%
998-
\tcode{round_toward_zero}
999-
if the rounding style is toward zero
1000-
\item
1001-
\indexlibrary{\idxcode{round_to_nearest}}%
1002-
\tcode{round_to_nearest}
1003-
if the rounding style is to the nearest representable value
1004-
\item
1005-
\indexlibrary{\idxcode{round_toward_infinity}}%
1006-
\tcode{round_toward_infinity}
1007-
if the rounding style is toward infinity
1008-
\item
1009-
\indexlibrary{\idxcode{round_toward_neg_infinity}}%
1010-
\tcode{round_toward_neg_infinity}
1011-
if the rounding style is toward negative infinity
1012-
\end{itemize}
1013-
1014-
\rSec3[denorm.style]{Type \tcode{float_denorm_style}}
1015-
1016-
\indexlibrary{\idxcode{float_denorm_style}}%
1017-
\begin{codeblock}
1018-
namespace std {
1019-
enum float_denorm_style {
1020-
denorm_indeterminate = -1,
1021-
denorm_absent = 0,
1022-
denorm_present = 1
1023-
};
1024-
}
1025-
\end{codeblock}
1026-
1027-
\indextext{denormalized value|see{number, subnormal}}%
1028-
\indextext{value!denormalized|see{number, subnormal}}%
1029-
\indextext{subnormal number|see{number, subnormal}}%
1030-
\indextext{number!subnormal}%
1031-
\pnum
1032-
The presence or absence of subnormal numbers (variable number of exponent bits)
1033-
is characterized by the values:
1034-
1035-
\begin{itemize}
1036-
\item
1037-
\indexlibrary{\idxcode{denorm_indeterminate}}%
1038-
\tcode{denorm_indeterminate}
1039-
if it cannot be determined whether or not the type allows subnormal values
1040-
\item
1041-
\indexlibrary{\idxcode{denorm_absent}}%
1042-
\tcode{denorm_absent}
1043-
if the type does not allow subnormal values
1044-
\item
1045-
\indexlibrary{\idxcode{denorm_present}}%
1046-
\tcode{denorm_present}
1047-
if the type does allow subnormal values
1048-
\end{itemize}
1049-
10501051
\rSec3[numeric.special]{\tcode{numeric_limits} specializations}
10511052

10521053
\pnum
@@ -1165,9 +1166,7 @@
11651166
}
11661167
\end{codeblock}
11671168

1168-
\rSec2[c.limits]{C library}
1169-
1170-
\rSec3[climits.syn]{Header \tcode{<climits>} synopsis}
1169+
\rSec2[climits.syn]{Header \tcode{<climits>} synopsis}
11711170

11721171
\indexlibrary{\idxcode{CHAR_BIT}}%
11731172
\indexlibrary{\idxcode{SCHAR_MIN}}%
@@ -1220,7 +1219,7 @@
12201219

12211220
\xref ISO C 5.2.4.2.1
12221221

1223-
\rSec3[cfloat.syn]{Header \tcode{<cfloat>} synopsis}
1222+
\rSec2[cfloat.syn]{Header \tcode{<cfloat>} synopsis}
12241223

12251224
\indexlibrary{\idxcode{DBL_DECIMAL_DIG}}%
12261225
\indexlibrary{\idxcode{DBL_DIG}}%

0 commit comments

Comments
 (0)