tmp/tmp15vdtyif/{from.md → to.md}
RENAMED
|
@@ -1,25 +1,17 @@
|
|
| 1 |
-
## Integral conversions <a id="conv.integral">[[conv.integral]]</a>
|
| 2 |
|
| 3 |
A prvalue of an integer type can be converted to a prvalue of another
|
| 4 |
integer type. A prvalue of an unscoped enumeration type can be converted
|
| 5 |
to a prvalue of an integer type.
|
| 6 |
|
| 7 |
-
If the destination type is unsigned, the resulting value is the least
|
| 8 |
-
unsigned integer congruent to the source integer (modulo 2ⁿ where n is
|
| 9 |
-
the number of bits used to represent the unsigned type).
|
| 10 |
-
|
| 11 |
-
[*Note 1*: In a two’s complement representation, this conversion is
|
| 12 |
-
conceptual and there is no change in the bit pattern (if there is no
|
| 13 |
-
truncation). — *end note*]
|
| 14 |
-
|
| 15 |
-
If the destination type is signed, the value is unchanged if it can be
|
| 16 |
-
represented in the destination type; otherwise, the value is
|
| 17 |
-
*implementation-defined*.
|
| 18 |
-
|
| 19 |
If the destination type is `bool`, see [[conv.bool]]. If the source
|
| 20 |
type is `bool`, the value `false` is converted to zero and the value
|
| 21 |
`true` is converted to one.
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
The conversions allowed as integral promotions are excluded from the set
|
| 24 |
of integral conversions.
|
| 25 |
|
|
|
|
| 1 |
+
### Integral conversions <a id="conv.integral">[[conv.integral]]</a>
|
| 2 |
|
| 3 |
A prvalue of an integer type can be converted to a prvalue of another
|
| 4 |
integer type. A prvalue of an unscoped enumeration type can be converted
|
| 5 |
to a prvalue of an integer type.
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
If the destination type is `bool`, see [[conv.bool]]. If the source
|
| 8 |
type is `bool`, the value `false` is converted to zero and the value
|
| 9 |
`true` is converted to one.
|
| 10 |
|
| 11 |
+
Otherwise, the result is the unique value of the destination type that
|
| 12 |
+
is congruent to the source integer modulo 2ᴺ, where N is the width of
|
| 13 |
+
the destination type.
|
| 14 |
+
|
| 15 |
The conversions allowed as integral promotions are excluded from the set
|
| 16 |
of integral conversions.
|
| 17 |
|