From Jason Turner

[conv.fpint]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpxehxmmpu/{from.md → to.md} +12 -7
tmp/tmpxehxmmpu/{from.md → to.md} RENAMED
@@ -1,20 +1,25 @@
1
  ## Floating-integral conversions <a id="conv.fpint">[[conv.fpint]]</a>
2
 
3
- A prvalue of a floating point type can be converted to a prvalue of an
4
  integer type. The conversion truncates; that is, the fractional part is
5
  discarded. The behavior is undefined if the truncated value cannot be
6
- represented in the destination type. If the destination type is `bool`,
7
- see  [[conv.bool]].
 
 
8
 
9
  A prvalue of an integer type or of an unscoped enumeration type can be
10
- converted to a prvalue of a floating point type. The result is exact if
11
  possible. If the value being converted is in the range of values that
12
  can be represented but the value cannot be represented exactly, it is an
13
  *implementation-defined* choice of either the next lower or higher
14
- representable value. Loss of precision occurs if the integral value
15
- cannot be represented exactly as a value of the floating type. If the
16
- value being converted is outside the range of values that can be
 
 
 
17
  represented, the behavior is undefined. If the source type is `bool`,
18
  the value `false` is converted to zero and the value `true` is converted
19
  to one.
20
 
 
1
  ## Floating-integral conversions <a id="conv.fpint">[[conv.fpint]]</a>
2
 
3
+ A prvalue of a floating-point type can be converted to a prvalue of an
4
  integer type. The conversion truncates; that is, the fractional part is
5
  discarded. The behavior is undefined if the truncated value cannot be
6
+ represented in the destination type.
7
+
8
+ [*Note 1*: If the destination type is `bool`, see 
9
+ [[conv.bool]]. — *end note*]
10
 
11
  A prvalue of an integer type or of an unscoped enumeration type can be
12
+ converted to a prvalue of a floating-point type. The result is exact if
13
  possible. If the value being converted is in the range of values that
14
  can be represented but the value cannot be represented exactly, it is an
15
  *implementation-defined* choice of either the next lower or higher
16
+ representable value.
17
+
18
+ [*Note 2*: Loss of precision occurs if the integral value cannot be
19
+ represented exactly as a value of the floating type. — *end note*]
20
+
21
+ If the value being converted is outside the range of values that can be
22
  represented, the behavior is undefined. If the source type is `bool`,
23
  the value `false` is converted to zero and the value `true` is converted
24
  to one.
25