Annex F (informative) Core undefined behavior [ub]

F.3 [expr]: Expressions [ub.expr]

F.3.6[ub:conv.double.out.of.range]
Specified in: [conv.double]

Converting a floating-point value to a type that cannot represent the value has undefined behavior.
[Example 1: #include <limits> int main() { // Assuming 32-bit int, 32-bit float and 64-bit double. double d2 = std::numeric_limits<double>::max(); float f = d2; // undefined behavior on systems where the range of representable values // of float is [-max,+max]; on systems where the range of representable // values is [-inf,+inf] this would not be undefined behavior int i = d2; // undefined behavior, the max value of double is not representable as int } — end example]