Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0ba5424

Browse files
jfbastienzygoloid
authored andcommitted
[basic.fundamental] Rename 'range exponent' to 'width' to align with C
1 parent 9e00558 commit 0ba5424

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

source/basic.tex

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4512,7 +4512,7 @@
45124512
\defnx{signed integer types}{signed integer type}.
45134513
The range of representable values for a signed integer type is
45144514
$-2^{N-1}$ to $2^{N-1}-1$ (inclusive),
4515-
where \placeholder{N} is called the \defn{range exponent} of the type.
4515+
where \placeholder{N} is called the \defn{width} of the type.
45164516
\indextext{integral type!implementation-defined \tcode{sizeof}}%
45174517
\begin{note}
45184518
Plain \tcode{int}s are intended to have
@@ -4540,7 +4540,7 @@
45404540
there exists a corresponding \defn{extended unsigned integer type}.
45414541
The standard and extended unsigned integer types
45424542
are collectively called \defnx{unsigned integer types}{unsigned integer type}.
4543-
An unsigned integer type has the same range exponent \placeholder{N}
4543+
An unsigned integer type has the same width \placeholder{N}
45444544
as the corresponding signed integer type.
45454545
\indextext{arithmetic!\idxcode{unsigned}}%
45464546
The range of representable values for the unsigned type is
@@ -4568,9 +4568,9 @@
45684568
the largest value of the corresponding unsigned type.
45694569
\end{example}
45704570

4571-
\begin{floattable}{Minimum range exponent}{tab:range.exponent}{ll}
4571+
\begin{floattable}{Minimum width}{tab:width}{ll}
45724572
\topline
4573-
\lhdr{Type} & \rhdr{Minimum range exponent $N$} \\
4573+
\lhdr{Type} & \rhdr{Minimum width $N$} \\
45744574
\capsep
45754575
\tcode{signed char} & 8 \\
45764576
\tcode{short} & 16 \\
@@ -4580,10 +4580,10 @@
45804580
\end{floattable}
45814581

45824582
\pnum
4583-
The range exponent of each signed integer type
4584-
shall not be less than the values specified in \tref{range.exponent}.
4583+
The width of each signed integer type
4584+
shall not be less than the values specified in \tref{width}.
45854585
The value representation of a signed or unsigned integer type
4586-
comprises $N$ bits, where N is the respective range exponent.
4586+
comprises $N$ bits, where N is the respective width.
45874587
Each set of values for any padding bits\iref{basic.types}
45884588
in the object representation are
45894589
alternative representations of the value specified by the value representation.
@@ -4596,11 +4596,11 @@
45964596
the constraints given in ISO C 5.2.4.2.1.
45974597
\end{note}
45984598
Except as specified above,
4599-
the range exponent of a signed or unsigned integer type is
4600-
\impldef{range exponent of integral type}.
4599+
the width of a signed or unsigned integer type is
4600+
\impldef{width of integral type}.
46014601

46024602
\pnum
4603-
Each value $x$ of an unsigned integer type with range exponent $N$ has
4603+
Each value $x$ of an unsigned integer type with width $N$ has
46044604
a unique representation $x = x_0 2^0 + x_1 2^1 + \ldots + x_{N-1} 2^{N-1}$,
46054605
where each coefficient $x_i$ is either 0 or 1;
46064606
this is called the \defn{base-2 representation} of $x$.
@@ -4652,7 +4652,7 @@
46524652
\end{note}
46534653
\begin{note}
46544654
A bit-field of narrow character type whose width is larger than
4655-
the range exponent of that type has padding bits; see \ref{basic.types}.
4655+
the width of that type has padding bits; see \ref{basic.types}.
46564656
\end{note}
46574657

46584658
\pnum

source/classes.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2887,7 +2887,7 @@
28872887
with a value greater than or equal to zero and
28882888
is called the \defn{width} of the bit-field.
28892889
If the width of a bit-field is larger than
2890-
the range exponent of the bit-field's type
2890+
the width of the bit-field's type
28912891
(or, in case of an enumeration type, of its underlying type),
28922892
the extra bits are padding bits\iref{basic.types}.
28932893
\indextext{allocation!implementation-defined bit-field}%
@@ -2939,7 +2939,7 @@
29392939
If a value of integral type (other than \tcode{bool}) is stored
29402940
into a bit-field of width $N$ and the value would be representable
29412941
in a hypothetical signed or unsigned integer type
2942-
with range exponent $N$ and the same signedness as the bit-field's type,
2942+
with width $N$ and the same signedness as the bit-field's type,
29432943
the original value and the value of the bit-field compare equal.
29442944
If the value \tcode{true} or \tcode{false} is stored into a bit-field of
29452945
type \tcode{bool} of any size (including a one bit bit-field), the

source/declarations.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6833,7 +6833,7 @@
68336833
For an enumeration whose underlying type is fixed, the values of
68346834
the enumeration are the values of the underlying type. Otherwise,
68356835
the values of the enumeration are the values representable by
6836-
a hypothetical integer type with minimal range exponent $M$
6836+
a hypothetical integer type with minimal width $M$
68376837
such that all enumerators can be represented.
68386838
The width of the smallest bit-field large enough to hold all the values of the
68396839
enumeration type is $M$.

source/expressions.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@
898898
\indextext{conversion!to signed}%
899899
Otherwise, the result is the unique value of the destination type
900900
that is congruent to the source integer modulo $2^N$,
901-
where $N$ is the range exponent of the destination type.
901+
where $N$ is the width of the destination type.
902902

903903
\pnum
904904
The conversions allowed as integral promotions are excluded from the set
@@ -5791,12 +5791,12 @@
57915791
left operand.
57925792
\indextext{left shift!undefined}%
57935793
The behavior is undefined if the right operand is negative, or greater
5794-
than or equal to the range exponent of the promoted left operand.
5794+
than or equal to the width of the promoted left operand.
57955795

57965796
\pnum
57975797
The value of \tcode{E1 << E2} is the unique value congruent to
57985798
$\tcode{E1} \times 2^\tcode{E2}$ modulo $2^N$,
5799-
where $N$ is the range exponent of the type of the result.
5799+
where $N$ is the width of the type of the result.
58005800
\begin{note}
58015801
\tcode{E1} is left-shifted \tcode{E2} bit positions;
58025802
vacated bits are zero-filled.

0 commit comments

Comments
 (0)